SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Location
    Chennai
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,687
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by muthuraja View Post
    this script Last two years working fine (no issues) in firefox but newly occer this error (FF4.0).
    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.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Oct 2007
    Location
    Chennai
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    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)

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,687
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by muthuraja View Post
    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.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •