getscript Questions
9
Solved
I'm trying to load JS scripts dynamically, but using jQuery is not an option.
I checked jQuery source to see how getScript was implemented so that I could use that approach to load scripts using n...
Lobworm asked 30/5, 2013 at 15:6
8
Solved
I'm writing an engine that requires the use of getScript quite extensively. I've pushed it into its own function, for ease of use, but now I need to make sure that the function itself is synchronou...
Liberty asked 8/2, 2013 at 23:29
6
Solved
By Default $.getScript() disables caching and you can use $.ajaxSetup and set caching to true. When testing if the script is actually cached with Firebug most of the time the script is coming back ...
Tiffie asked 14/10, 2012 at 16:18
10
Solved
I have a bunch of JavaScript files that I would like to include in the page, but I don't want to have to keep writing
<script type="text/javascript" src="js/file.js"></script>
So is...
Donor asked 13/11, 2010 at 22:12
3
Solved
Suppose I have the following script, called include_strict.js. After it executes I should have window.global1 defined:
"use strict";
var globalVar = {};
alert(typeof window.globalVar);
But if I...
Pskov asked 8/10, 2012 at 6:31
5
Solved
I'm working on a site that serves content via AJAX.
If you click an item in the menu, a content div gets updated with $.get response, nothing fancy.
I'm implementing history.pushState to allow na...
Telpherage asked 6/3, 2011 at 10:47
1
Solved
I'm loading scripts with jQuery ajax.
Here's a snip from the loader code, for what it's worth.
var resources = ['knockout-3.2.0.js', 'fonts/fontawesome-webfont.eot', ... ];
var retryCount = 0;
l...
Centaury asked 8/4, 2015 at 3:19
2
Solved
I am trying to load a script with a function like:
$.getScript('/js/mymy.js').done(function(){
if(readCookie('my_cookie', 'yes')){
/* do sth here */
}
});
or
$.getScript('/js/mymy.js',func...
2
Solved
I am working on updating my website, which now uses an AJAX engine. My engine works well, up-to-hand for some reason some pages do not execute javascript, let me explain: when the anchor change I u...
Ripping asked 6/1, 2015 at 5:8
3
Solved
I'm currently stuck using several JavaScript libraries that MUST load in a very specific order. Since jQuery's getScript() is asynchronous it starts downloading all of the scripts very quickly and,...
Redding asked 16/8, 2011 at 19:0
4
Solved
I need to use a javascript function from an external js file inside another js file. This is basically the code I've tried:
$.getScript('js/myHelperFile.js');
myHelperFunction();
This doesn't wo...
5
Solved
I've got a jQuery function that is called after a doubleclick on a list item.
app/assets/javascripts/tile/tile.js
$('#list > li').dblclick(function(){
// styling
$(this).toggleClass('liked'...
Alessi asked 18/7, 2013 at 19:28
4
Solved
It seems that helloworld.js gets loaded multiple times based on the number of times I click #load. I say this because when I look at Google Chromes Developer Tools Network tab, it shows helloworld....
Hospitalize asked 14/11, 2012 at 15:28
2
Solved
I'm trying to load two scripts with the $.getScript function of getting Google Map script, then after that is loaded, I get another script (goMap) which makes map applets easily to be made.
Howeve...
Nonlinearity asked 18/2, 2012 at 17:57
3
Solved
My guess is that the src file needs to be XML-friendly, but of course none of the JS file is since it's using all sorts of non-XML compliant entities.
getScript() may be expecting an XML file =/
...
2
Solved
I am trying to understand the internal process of getScript. I am aware that it uses $.get method interally.I was thinking that jQuery puts a script tag reference into the DOM for being able execut...
1
Solved
I am trying to cache a very simple javascript response. I am using rails and my views/projects/index.js.erb contains only the following:
alert('hi');
and when I request
$.ajax({
type: 'GET',...
Fourpence asked 23/3, 2011 at 2:9
4
Solved
Can not figure out how to theme an ajax loaded recaptcha. The below code does not work.
From Google Recaptcha
Saw this post Recaptcha ajax API custom theme not working, but I am definitely viewing...
Measureless asked 11/3, 2011 at 22:30
2
Solved
When I load a script with .getScript('file.js') is there a way to do remove that script later? sort of like a clean where I say delete the js I loaded earlier
Tarnation asked 24/2, 2011 at 17:11
5
I don't understand the reason for replacing this:
<script src="js/example.js"></script>
with this:
$.getScript('js/example.js', function() {
alert('Load was performed.');
});
Is ...
Flitch asked 8/12, 2010 at 22:10
1
Solved
To speed up the load time of our site, we defer the loading of some scripts. This has been working fine until a couple of days ago. I've boiled the issue down to this short page of HTML.
<!DOCT...
1
© 2022 - 2024 — McMap. All rights reserved.