This issue occers only Firefox 4.0 version

Hi friends,

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>Title</title>

<script type=“text/javascript”>
(function() {
var s = [
“js/common.js”,
“js/function.js”,
“js/ajax.js”,
“js/initial.js”
];
for(var i=0, l=s.length; i<l; ++i) {
var sc = “script”, tp = “text/javascript”;
if(window.navigator.userAgent.indexOf(“MSIE”)!==-1 || window.navigator.userAgent.indexOf(“WebKit”)!==-1) {
document.writeln(“<” + sc + " type=\“” + tp + “\” src=\“” + s[i] + “\”></" + sc + “>”);
} else {
var t=document.createElement(sc), sa = “setAttribute”;
t[sa](“src”, s[i]);
t[sa](“type”, tp);
document.getElementsByTagName(“head”)[0].appendChild(t);
}
}
})();
</script>
<link href=“css/common.css” rel=“stylesheet” type=“text/css”>
</head>
<body>

//here is my html code

<script type=“text/javascript”>
makeAjax(‘data.php’);
</script>
</body>
</html>

Error is makeAjax is not a function (this issue occers only Firefox 4.0 browser) How to solve the problem?

this script Last two years working fine (no issues) in firefox but newly occer this error (FF4.0).

MuthuRaja S

Yep, that’s a known issue with adding dynamic scripts to the head.
You might have to wait until the DOM is ready, or even page load, for the function to become available.

Thx for UR reply paul.
Any other option for downloading External scripts(Other Domain) dynamicaly .(i dont check DOM is ready, just i call a funtion)

You’re welcome to see if any of these javascript loader micro-scripts do the job any better on Firefox 4. I look forward to hearing news of the result.