The dynamic-script-loading tag has no wiki summary.
0
votes
1answer
21 views
Require.js — how to load relative to a module directory
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 ...
-1
votes
0answers
46 views
Javascript Handle Timeout [closed]
The scenario is I'm loading a third party script file (which I do not have any control) dynamically via ClientScriptManager.RegisterStartupScript method.
For example I am referencing into this ...
1
vote
1answer
39 views
“is” operator exhibiting unexpected behavior in IronPython scripts
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 ...
0
votes
0answers
156 views
Loading jQuery async with local fallback - fallback is sometimes loaded twice & general questions
I am trying to load jQuery from a CDN and if that fails, load a local fallback. I am using Modernizr for that. While testing if this works I encountered some stuff that makes me wonder, but first the ...
9
votes
3answers
205 views
Wrapper to allow a module to work with AMD/CommonJs or script tags?
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 ...
0
votes
1answer
99 views
How to make a fallback to a whole folder in requireJS
I understood how I can config in requireJS a fallback for a single file like this:
var skin = "christmas";
requirejs.config({
paths: {
languagesLocal : [
BaseUrl + ...
3
votes
2answers
666 views
How to mixin Underscore plugins in RequireJS?
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:
...
1
vote
0answers
110 views
Buzz.js loading very slowly
I'm using buzz.js for a Javascript project loading .wav files across domains, but I'm having a problem with many of the sounds loading before the player begins to play, or just loading altogether. ...
1
vote
2answers
94 views
jQuery: Update jQuery-version on the fly via $.getScript
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 ...
1
vote
1answer
140 views
Injecting a script to page with callback
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 ...
3
votes
3answers
577 views
How to check if an asynchronously loaded script has finished loading in javascript
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 ...
0
votes
1answer
131 views
Force a script refresh using the “yepnope” Javscript script loader
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 ...
0
votes
3answers
83 views
How to pass returned public object from loaded JavaScript file into callback function?
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 ...
0
votes
1answer
92 views
displaying progress bar for labjs, labjs callbacks
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 ...
-2
votes
2answers
195 views
JavaScript: Dynamic Script Loading without manipulating the DOM?
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 ...
3
votes
1answer
600 views
Modernizr/ yepnope execution order WRT jQuery + plugins troubleshooting
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 ...
1
vote
1answer
190 views
Access to global variables with script loader injected scripts
I'm trying to wrap my head around a particular subtlety of using asynchronous script loaders (head.js, yepnope, etc.). I have a page setup like so:
<body>
<script type="text/javascript" ...
0
votes
3answers
525 views
asp.net script loader master pages and path errors
I am using [script.js][1] as async script loader along with my master page. The pages on the root are working fine using the master page file as it's master page. When it comes to web pages that are ...
1
vote
3answers
632 views
Javascripts added via appendChild don't seem to run
I've got a javascript file being added dynamically to a page. If I use document.write, it works fine:
<html>
<head></head>
<body>
<script type="text/javascript">
...
1
vote
1answer
247 views
Resource Loader with ready() function call and that also loads CSS?
Ideally I'm looking for a Javascript resource loader that will:
(1) Allow me to make "ready" calls like head.js does, e.g.
head.ready(function() {
$("#my").jquery_plugin();
});
// load jQuery ...
4
votes
2answers
239 views
What's the advantage of using a script loader over concatenating your script files in a build process?
I've been hearing a lot about script loaders such as RequireJS. What's the advantage of using a script loader over concatenating your source files in a build process?
0
votes
2answers
130 views
Incomplete executable self-loading closures
Is it possible for browsers/ajax/javascript to autocomplete, and close the self-loading closures if they are left open ..?
1 (function()
2 {
3 function a(n){this.name=n;}
4 var a=this;
5 //more code ...
12
votes
1answer
2k views
What is causing my scripts to be requested twice while using Modernizr.load (yepnope.js)
I am using yepnope.js to load javascript files dynamically,and I've noticed that my scripts appear to be loaded twice according to Firebug and Webkit Inspector.
The problem is that in Firebug's Net ...
5
votes
2answers
477 views
How to get cross domain request's response in javascript
I am making a cross domain request in javascript by dynamically adding a script and setting its src attribute to the domain that I need to make request to.
For reference: ...
0
votes
1answer
104 views
$script.js nested dependencies
Is there a way to make the following work with $script.js:
control.js
$script('accounts.js', function() {
// fnA
});
accounts.js
$script('util.js', function() {
// fnB
});
I would have ...
5
votes
4answers
5k views
Dynamically and synchronously load JavaScript file from a different domain
I would like to synchronously include a JavaScript file from a different domain via code. This means that using a synchronous XMLHttpRequest will not work. I also want to avoid document.write because ...
30
votes
2answers
8k views
Why use something like Require.JS rather than simply creating a <script> element in the DOM?
What advantages does Require.JS offer in comparison to simply creating a element in the DOM? My understanding of Require.JS is that it offers the ability to load dependencies. But can this not simply ...
2
votes
1answer
784 views
Howto disable client script block server side (asp.net)
I have js script block (very long one that does editing capabilities to an invoice page).
I want to enable/disable this functionality on the server-side. First thing popped up on my mind was to say ...
0
votes
1answer
229 views
why isn't jQuery loading?
When using an importjs() type of function (see below for an example), jQuery doesn't seem to be loading before the code following it.
Here's a sample html file:
<html>
...
6
votes
6answers
917 views
Dynamic script addition should be ordered?
I'm adding some <script> tags dynamically to the head element after page load. I understand the scripts are loaded asynchronously, but can I expect them to be parsed in the order they are added?
...