Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jquery unable to load js, but code works fine in console

vishal goyal May 17, 2018

AJS.$(document).bind('dialogContentReady ready', function(event, dialog){
 
        var calling_host = "jira";
        if(window.location.origin == "https://SDSD.com" || window.location.origin == "https://SSS.com")
        {
            calling_host = "jira blue";
        }
        else if(window.location.origin == "AAA" || window.location.origin == "https://BBB.com")
        {
            calling_host = "jira orange";
        }
        
     var chatbot_url = "";
        if(window.location.origin.indexOf("test") > -1)
        {
            chatbot_url = "https://QQ.com";
        }
        else
        {
            chatbot_url = "tt.com";
        }
    
    jQuery('head').append("<script src='" + chatbot_url + "/MBot/otto.js'>");
      
            
 setTimeout(loadOtto, 2000);
                
          
         function loadOtto() {
          var obj = Object.create(Otto);
            obj.init(chatbot_url, calling_host);
}

});

2 answers

0 votes
vishal goyal May 17, 2018

Thanks the above solution worked I was having cache issue, adding settimeout make it run.

Arun_Thundyill_Saseendran
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 17, 2018

Cool! 

ION Information Systems
Contributor
May 20, 2018

Thanks Arun for looking into request :)

0 votes
vishal goyal May 17, 2018

@Arun_Thundyill_SaseendranCan you help me in this.???

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events