Questions tagged [getscript]
188 questions
3
votes
0 answers
Load TinyMce JS file on document.ready() not working with $.getScript
I'm trying like this,
$.getScript('js/tiny_mce/tiny_mce.js',function(){
recargar_tiny();
});
on document.ready()
On firebug log: .js loaded OK, no errors
But seems that recargar_tiny() wich is:
function recargar_tiny(){
…

Toni Michel Caubet
- 19,333
- 56
- 202
- 378
3
votes
4 answers
How can I use a function which is into another .js file?
Here is the simplified of my code:
// script1.js
$(document).ready(function(){
.
.
function myfunc(){ ... }
.
.
});
// script2.js
$(document).ready(function(){
.
.
//doesn't work
$.getScript("./script1.js");
…

stack
- 10,280
- 19
- 65
- 117
3
votes
1 answer
Difference between document.createElement('script') vs jQuery .getScript
I've been having an issue getting .getScript to work in some odd cases.
For instance, this works to load the scripts only when needed.
function twitterSDK() {
$jQ.getScript('http://platform.twitter.com/widgets.js');
}
function diggShare() {
…

Sahas Katta
- 1,716
- 3
- 14
- 24
3
votes
0 answers
jQuery getScript() not working in IE11
In an HTML5 app I'd like to defer the loading of some big JavaScript files to give faster UI control to the user.
Using
Still waits until the script loads before turning things over to the user when I set the…

hoekma
- 793
- 9
- 19
3
votes
1 answer
getScript in noconflict-mode
Due to Wordpress loading jQuery in nonconflict-mode, I must wrap my scripts inside jQuery(function($){...})
The parent script executes as expected.
However, I conditionally load a 2nd script via getScript:
$.getScript('js/2nd.js').done(function() {
…

Raphael Jeger
- 5,024
- 13
- 48
- 79
3
votes
1 answer
Retrieve script content from jQuery.getScript or jQuery.ajax with dataType script
According to jQuery's documentation, setting dataType: 'script' in $.ajax
Evaluates the response as JavaScript and returns it as plain text.
I got the evaluation part working fine but the response I get is undefined, not a plain text version of…

Omar Meky
- 596
- 1
- 5
- 16
3
votes
1 answer
Calling code after jQuery getScript executes the script
We use $.getScript(url, callback) all over the place. In troubleshooting very occasional undefined errors, i noticed this from the jQuery documentation:
"The callback is fired once the script has been loaded but not
necessarily executed."
Can…

Orlando
- 147
- 1
- 9
3
votes
1 answer
jQuery getScript() sometimes works fine, sometimes returns "parsererror" and TypeError Exception
I have strange problem with jQuery (currently 1.9.1 version), I am using getScript() function to load some additional JS library on demand. It loads everytime the same library from the same libraries, so there is no difference between multiple…

Frodik
- 14,986
- 23
- 90
- 141
3
votes
7 answers
Having difficulty working with global variables and $.getScript
I have the following script which does not work properly:
function getWidgetContent( widget ) {
if(widget.script!=null){
$global_widget_id = widget.widget_id;
$.getScript( "js/" + widget.script, function() {
$(…

oshirowanen
- 15,297
- 82
- 198
- 350
3
votes
2 answers
jquery getScript function never fails?
The jQuery getScript fail function is never called. See this fiddle:
http://jsfiddle.net/getsetbro/8xNMs/
$.getScript("http://api.jquery.com/scripts/jquery.NO-SUCH-FILE.js").done(function() {
console.log('yep');
}).fail(function() {
…

getsetbro
- 1,798
- 1
- 22
- 33
2
votes
1 answer
jQuery's getScript - including files into the main scope?
I have thought a lot about how I should include files in my backbone.js-application. In production, I am obviously going to join my files and minimize them to keep requests at a minimum, but during development, it would be nice to just have all…

Industrial
- 41,400
- 69
- 194
- 289
2
votes
2 answers
A way of disposing scripts files previously loaded with $.getScript()
Sorry about my English. I'm developing a chess interactive site. There is a lesson menu, when the user selects the lesson, it's loaded using $.getScript(). Lesson file only has a variable lesson that contains a "big" json object. When user selects…

morgar
- 2,339
- 17
- 16
2
votes
2 answers
jQuery Ajax load and getScript
I'm trying to set up my site so that content in the main area is loaded via javascript (some pages take a while to render). However, I've run into a bit of a logical problem when using jQuery.load(), jQuery.getScript and jQuery.ajax().
I need to be…

John Doe
- 298
- 1
- 3
- 16
2
votes
1 answer
getScript, loading multiple scripts in series?
I am trying to load multiple .js files through the GetScript method.
I need them to be loaded in series, meaning the first .js files needs to be fully loaded before going to the next one.
Question 1: I was using the code below, but found that this…

RobbTe
- 385
- 4
- 19
2
votes
1 answer
Uncaught TypeError: $.getScript(...).done is not a function
I faced a weird situation here..
.
Below code is working:
// this code working perfectly
$.getScript( "https://wchat.freshchat.com/js/widget.js" ).done(( script, textStatus )=>{
// run something
});
.
.
But if I put the whole code inside…

Syamsoul Azrien
- 2,534
- 4
- 32
- 55