javascript - shopify app (python)Uncaught ReferenceError: require is not defined -
with shopify api python
i able place script tag in (client's) store .
problem having 2 script tags among 1 require.js.
store page's source code (client's store)
var urls = ["myjsfilewithrequire.js? shop=store.myshopify.com","mysecondfile.js?shop=store.myshopify.com"];
this gets loaded .
how can make sure 1 js loaded completed (requre.js) before rest files loaded .
is way of doing right ? ( have not tired yet )
var imported = document.createelement('script'); imported.src = 'myscriptfile.js'; document.head.appendchild(imported); function load_data(){ undone = true; while(typeof(window.myscriptfile.data)=="object" && undone){ loop();}
i guess there must better way .
i had same problem, , solved using almond.
it's maintainer of requirejs, , light-weight amd loader. can compiled in optimized js, , included (as scripttag) in client's shopify site.
Comments
Post a Comment