Question

I am working on crossrider to make an extension that needs to add two remote JS to all pages loaded using https protocole. one script should come before and the other one should be loaded after . I tried to follow the docs provided in crossrider website but all my attempts failed. Can you please help me to finish this. This is what U tried to do

     appAPI.ready(function($) {
     src="http://code.jquery.com/jquery-1.10.1.min.js" />
     appAPI.dom.addRemoteJS({
     url: "http://code.jquery.com/jquery-1.10.1.min.js",
     additionalAttributes: {charset: "UTF-8"},
     callback: function(ref) {
        appAPI.dom.addRemoteJS({
            url: "http://domain.com/script.js"
        });
     }
     });
     });
Was it helpful?

Solution

In general, the snippet is correct and conforms to the example provided in the Crossrider docs.

Upon testing your specific script URL (that you provided elsewhere for privacy reasons) I can see in the console that that there is an error in the second script called in the callback function, i.e. the script.js in the example snippet you provided. Once you fix this error, you can proceed to complete your extension.

[Disclaimer: I am a Crossrider employee]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top