Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
0 answers
235 views

With Nextjs 14 i'm trying to create a component that can switch the running script depending on a prop that is passed: TLDR. I'm not trying to import a component or a node_module, this is an external ...
Lefan's user avatar
  • 11
1 vote
3 answers
1k views

I have a dynamic table where columns are moved every now and then. Therefore, I would like to reference my column name in my query. Unfortunately I do not know so well and the internet raises more ...
Scarlett Rautmann's user avatar
2 votes
1 answer
258 views

Is there a special qooxdoo class to load CSS files dynamically like qx.util.DynamicScriptLoader does for JavaScript files? For example, depends on user choice what geo maps he wants to use an ...
goldim's user avatar
  • 460
0 votes
0 answers
265 views

I have built an application that loads articles into a page component using an api from our server. The article loads correctly. Where I am having a problem is I have an embedded script in the api ...
jfulton's user avatar
  • 77
0 votes
1 answer
81 views

The below code does callback inside a callback. Why this is needed? Why can't it be 3 separate calls? Note loadScript just going to create a style tag and add script passed to the src attribute ...
AjithKumar's user avatar
1 vote
1 answer
1k views

From much reading I conclude: The <script> tag can store data, but it is only accessible if src is not used. I want to use src because it is how my script-loader works. Is the type attribute ...
user avatar
0 votes
1 answer
184 views

I dynamically added the Chrome Api Library (from https://www.gstatic.com/cv/js/sender/v1/cast_sender.js) to my project, and works as expected when I run using localhost:4200. However it doesn't work ...
tessarini's user avatar
  • 162
-16 votes
2 answers
645 views

Given a loader: function loader(src, callback, fail) { let s = document.head.appendChild(document.createElement('script')); s.type = "text/javascript"; s.src = src; s.onload = ...
user avatar
0 votes
0 answers
40 views

How to lazily load components from another host in Angular? Hello guys. I have a problem with Angular. My web application is deployed on a certain server(e.g. http://www.a.com), and my javascript ...
shengliang's user avatar
4 votes
1 answer
8k views

I have been trying to save resources on the page by not loading the Zendesk Widget unless required. If i manually add to a page the following tag everything works just fine: <script id="ze-...
Victor Albu's user avatar
0 votes
0 answers
413 views

I need to load VueJS dynamically using a script loader but I'm unable to understand why Vue doesn't initialize. Here's my simple script-loader: (function( w ){ var loadJS = function( src, cb ){ ...
Mridang Agarwalla's user avatar
0 votes
2 answers
231 views

I'm calling the function after adding the jquery script. but still, I'm getting a Reference error <script> window.onload = function(){ AddScript("https://cdn.syncfusion.com/js/...
vinoth-kumar-s's user avatar
0 votes
1 answer
175 views

I have tired some of DOM operation like, document.createElement document.write The document.createElement way requires a standard script structure . But in my case it can be either a java ...
Srik_Aanth's user avatar
2 votes
2 answers
6k views

at the top of the head of my document I dynamically load a script: <script> var script = document.createElement("script"); script.setAttribute("src", "mydomain.com/main.js"); var head = ...
Andre Brdoch's user avatar
0 votes
1 answer
2k views

I need to add a html element, a button, trough the Google Optimize experiment and it has to perform a certain script depending on the experiment. I have tried to do it in the following ways: <...
Zerg's user avatar
  • 829
0 votes
1 answer
161 views

I'm looking into tracking scripts that I've come across. Here's one by Funnelytics. At first look it seems like it has a bug: (function(funnel) { var insert = document.getElementsByTagName('...
Flimm's user avatar
  • 154k
0 votes
0 answers
269 views

My Scenario Suppose my android activity has a screen like this: All the fields are populated according to a response received from API. In the above scenario, the API response told to insert One ...
user9757884's user avatar
6 votes
0 answers
1k views

'turbolinks:load' is not getting triggered on the directly loaded pages but, on the pages loaded with turbolinks 'turbolinks:load' event is working fine. <!DOCTYPE html> <html> <...
Satyendra Tiwari's user avatar
7 votes
1 answer
6k views

Spotify has a new feature in beta supporting full song playback in browser, Web Playback SDK. The documentation shows an example of immediately initializing a player using script tags in the main HTML ...
bitwitch's user avatar
  • 515
8 votes
4 answers
2k views

I'm trying to load a JS file from a bookmarklet. The JS file has this JS that wraps the module: (function (root, factory) { if (typeof module === 'object' && module.exports) { // ...
Web_Designer's user avatar
  • 75.1k
0 votes
1 answer
344 views

I'm having what seems to be a really simple issue that I really can't find a solution for: In my code I have a script loaded in the header: <script type="text/javascript" src="../js/viewdoc/index....
Ricardo Melo's user avatar
0 votes
2 answers
746 views

When dynamically creating a script element and adding it to the page, my errors are not giving me line numbers of the script, but instead the line number where I append the script. The code below ...
Seph Reed's user avatar
  • 11.5k
1 vote
1 answer
103 views

I have two jspm modules, ModuleA and ModuleB. Both depend on the d3.js library. I have a third jspm module, ModuleC, which depends on ModuleA and ModuleB. When I run ModuleC, I get d3 errors, even ...
Nathan Friend's user avatar
0 votes
0 answers
37 views

I'm trying to wrap my mind around script loading from this website but don't understand the part about how appending a child to the head for the script will make a script accessible on demand. The ...
akantoword's user avatar
  • 3,114
1 vote
2 answers
4k views

Is it possible to load a javascript file in a browser (e.g. from some javascript code) without the loaded code being executed? The goal would be to just download the javascript file to ensure that ...
M4N's user avatar
  • 96.8k
-1 votes
2 answers
2k views

I'm truing to execute a yui js script with js.executeScript Selenium's method. The script is being executed by selenium webdriver in order simulate a "click" on hybrid mobile app (the button is ...
Igal's user avatar
  • 4,793
0 votes
1 answer
338 views

I am designing a platform for a site, where site users are allowed to execute scripts on JSON in browser window only Here is a screen shot of page: user will be getting the JSON, and whatever script ...
Prateek's user avatar
  • 299
18 votes
1 answer
6k views

I'm loading HTML in Ajax, parsing it with DOMParser and put all the childNodes of the document body into a document fragment. When I add the fragment into the current document's body, <script> ...
plalx's user avatar
  • 43.8k
8 votes
2 answers
3k views

I'm new to Browserify and I'm trying to figure out how to make it more efficient with regards to how much the client needs to download. I have a web app, that uses many different 3rd party libraries ...
Jake Wilson's user avatar
  • 91.8k
0 votes
1 answer
61 views

If I load a number of JavaScript files dynamically using code such as: element = document.createElement("script"); element.setAttribute("language", "javascript"); element.setAttribute("src", url); ...
izb's user avatar
  • 52.2k
2 votes
2 answers
2k views

I'm using yepnope to load scripts conditionally, based on some tests, and I'm also using browserify, via grunt-browserify to build my scripts. Now I want one script to replace the other, but still be ...
knownasilya's user avatar
  • 6,161
11 votes
2 answers
16k views

How would you go about dynamically loading a web component - in response to a url route change for example? I won't know the requested component ahead of time, so could you simply use JavaScript to ...
TruMan1's user avatar
  • 36.6k
1 vote
0 answers
121 views

I'm writing a little locally-run web app that expects to have intermittent network access. With this in mind I'm checking to see if our external dependency (Google Maps) fails to load, and try again ...
Barney's user avatar
  • 16.5k
0 votes
0 answers
474 views

I'm having a difficult time wrapping my head around this issue, and I'm hoping some of you can shed some light on this for me. I have seen plenty of questions being asked which center around ...
Nick's user avatar
  • 141
1 vote
1 answer
384 views

I'm trying to load two blocks of lab.js in different places but if I use functions in the second block from files loaded in the first block, they show as undefined. This is the first block (loaded in ...
Cidwel's user avatar
  • 45
1 vote
1 answer
2k views

Google recommends scripts should be "deferred", but they do not mention the defer attribute of the <script> tag. I wonder why they don't even mention it, considering it has been around a while. ...
mike nelson's user avatar
  • 22.2k
4 votes
2 answers
386 views

Background Have a project that includes over 100 Javascript and HTML template files. Using a script loader (yepnope) that loads the files directly from our development environment so that during the ...
Chris Dutrow's user avatar
  • 50.7k
1 vote
1 answer
1k views

My structure looks like so: index.html main.js #holds the configs.path and configs.shim libs jquery.js require.js backbone.js underscore.js modules app main.js #want to load in ./views/app.js ...
dchhetri's user avatar
  • 7,176
1 vote
1 answer
120 views

Using the advice in the answers to this question, I created a new type (_NotInFile) and singleton instance (NotInFile) to represent a special condition in a series of IronPython scripts. I tested my ...
Larry Lustig's user avatar
  • 51.2k
17 votes
3 answers
5k views

I just took a shot at wrapping one of our modules that is meant to be included via a <script> tag in some boilerplate to allow optional AMD loading with requirejs. It was quite painful and the ...
George Mauer's user avatar
0 votes
1 answer
497 views

I understood how I can config in requireJS a fallback for a single file like this: var skin = "christmas"; requirejs.config({ paths: { languagesLocal : [ BaseUrl + ...
Alon's user avatar
  • 7,788
11 votes
3 answers
4k views

What is the right way to execute code on Underscore when it gets loaded? I am trying to execute the below code to extend the _ exported namespace automatically when modules require it: _.mixin(_.str....
TruMan1's user avatar
  • 36.6k
1 vote
3 answers
411 views

If you are in an environment that starts out with jQuery 1.7.x, are there any risks to run $.getScript and load the latest version of jQuery (1.8.3)? Will it overwrite the updated functions correctly ...
Seb Nilsson's user avatar
  • 26.5k
1 vote
1 answer
1k views

I'm trying to inject yepnope.js to page and then loading other JS files with yepnope. Chrome Dev Tools' network tab shows yepnope is fetched, elements tab show element is injected. But console tab ...
cnkt's user avatar
  • 2,973
6 votes
3 answers
3k views

Using javascript to asynchronously download another javascript file. I understand that this can be done by inserting a new script tag onto the page with the src attribute set to the file url. I also ...
Chris Dutrow's user avatar
  • 50.7k
0 votes
1 answer
421 views

Using yepnope.js. I need to "refresh" the script, but yepnope prevents files with the same url from being re-loaded. In the documentation, they suggest using a plugin to allow files to refresh. Is ...
Chris Dutrow's user avatar
  • 50.7k
0 votes
3 answers
791 views

I have a JavaScript file, which returns public methods. This JavaScript file I am not loading at the beginning, but preloading only when it's needed. Example: (function () { // Some privat vars and ...
Nik Sumeiko's user avatar
  • 8,841
0 votes
1 answer
260 views

How can I keep track of what scripts have been loaded so far so I can display a progress bar when using labjs (http://labjs.com/)? wait() doesn't work because then it won't parallel load the next ...
LordZardeck's user avatar
  • 8,283
-2 votes
2 answers
302 views

How do I add an external JavaScript(-library) to a page through JavaScript-code without: Manipulating the DOM Preferably without using Eval? That means adding a script-tag through JavaScript is not ...
Seb Nilsson's user avatar
  • 26.5k
3 votes
1 answer
874 views

I'm getting my head around Modernizr polyfill loading today and running into some trouble. I like the idea of loading jQuery in parallell and so have the CDN URI (with a local fallback) up top. Then I ...
Evan's user avatar
  • 409