Page 1 of 1

Firefox Problem for dynamic adding script

Posted: Thu Aug 21, 2008 11:43 pm
by qadeer_ahmad
Hi,
i am working in a drag and drop application where i need to add drag and drop function dynamically so i am mixing ajax and get ajax result as jquery function then i attach these function to header. Its work fine in IE but its not work in firefox.
here is javascript.

Code: Select all

var ss = document.createElement('script');
var scr = xmlHttp.responseText;
//ss.text = scr;
ss.setAttribute('text',scr);
var hh = document.getElementsByTagName('head')[0];
hh.appendChild(ss);
as "xmlHttp.responseText" is ajax response in shape of jquery function.
i also use javascript file but the result is same its not work in firefox.
script for file is

Code: Select all

var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://localhost/test/ajax/jquery_methods.js';
headID.appendChild(newScript);
Any help that its work in firefox too?

Thanks