[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-16 Thread fuzziman
Not sure if this is what you mean, but I can load external JS using a bookmarklet. For example, loading jquery onto any arbitary web page: javascript:var

[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-16 Thread Hamish Campbell
What is the output when you fire this: function loadJavascript(scriptFile) { var scriptsPath; // Builds the correct scripts path scriptsPath = $('script').attr('src'); scriptsPath = scriptsPath.replace(/\w+\.js$/, ''); $.getScript(scriptsPath +

[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-15 Thread Scott Trudeau
Look at $.getScript: http://docs.jquery.com/Ajax/jQuery.getScript Try something like: $(document).ready(function() { $.getScript('script/jquery.form.js'); }); You can wrap $.getScript in your function to do the script path prepend and .js append. No need to do all the messy DOM stuff

[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-15 Thread Nazgulled
I replaced the function with this: function loadJavascript(scriptFile) { var scriptsPath; // Builds the correct scripts path scriptsPath = $('script').attr('src'); scriptsPath = scriptsPath.replace(/\w+\.js$/, ''); $.getScript(scriptsPath + scriptFile +

[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-15 Thread Morgan Allen
.getScript()? On Jan 15, 2008 3:20 PM, Nazgulled [EMAIL PROTECTED] wrote: Hi, I'm trying to load JS files (libraries) dynamically at run-time with jQuery but I'm not being able to... I thought I had this working before but now it's not. Here's my code: INDEX.HTML html head script

[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-15 Thread Jeroen
On Jan 16, 2008 12:20 AM, Nazgulled [EMAIL PROTECTED] wrote: Hi, I'm trying to load JS files (libraries) dynamically at run-time with jQuery but I'm not being able to... AFAIK browsers do not support loading external JS after the DOM has loaded. I think this is the reason for the

[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-15 Thread Nazgulled
Any hints why $.getScript() is not working as it should? On Jan 15, 11:28 pm, Jeroen [EMAIL PROTECTED] wrote: On Jan 16, 2008 12:20 AM, Nazgulled [EMAIL PROTECTED] wrote: Hi, I'm trying to load JS files (libraries) dynamically at run-time with jQuery but I'm not being able to...

[jQuery] Re: Loading dynamic JS libraries with jQuery

2008-01-15 Thread Christof Donat
Hi, I'm trying to load JS files (libraries) dynamically at run-time with jQuery but I'm not being able to... I thought I had this working before but now it's not. Here's my code: Which Browser are you testing with? Generally there are two possibilities to load Scripts dynamically: 1. add a