SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SEO Link Building Master I, Brian's Avatar
    Join Date
    Apr 2003
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What does this JS do, please?

    I came across the following script ni a page, and wondered what it actually does - is it something for helping inter-browser compatibility? If so it's definitely something I could do with looking into better:

    Code:
    <script language="JavaScript">
    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    // -->
    </script>
    

    Internet Business Forums - free business help & advice

  2. #2
    I'm a college yuppie now! sbdi's Avatar
    Join Date
    Jul 2000
    Location
    Dublin , Ireland
    Posts
    1,271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There was a resize error bug in netscape. Not sure exactly what happened but it did something when the window was resized.

    That script is the "fix" for it
    Back Again

  3. #3
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,811
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    fwiw, that script is Dreamweaver produced and is I believe "on" by default in version 4 and below.
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a resize event handler for NN4. I use a little different technique than this.

    NN4 can issue the resize event when the window hasn't actually been resized. So this handler compares the current window size to the previous window size to see if there has been a real resize.

  5. #5
    SEO Link Building Master I, Brian's Avatar
    Join Date
    Apr 2003
    Posts
    1,284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much for the replies.
    Internet Business Forums - free business help & advice


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
  •