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
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 +
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
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 +
.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
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
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...
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
8 matches
Mail list logo