#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    7
    Rep Power
    0

    Unhappy Including JavaScript files with Mozilla


    I am trying to transfer some of my JavaScript files over to work with Mozilla, and I am running into an interesting problem. I have included a small list of JavaScript files as includes. One of the library functions in one file calls a different function that exists in a different file. In Internet Explorer, this works fine, but for some reason, Mozilla simply quits executing the JavaScript when it attempts to make the function call.

    Is there a difference in function scope rules between Netscape and IE, or is this an "undocumented feature" of Mozilla? I cannot seem to find any information about this problem.

    Khomar
  2. #2
  3. T-Shirt Tragic
    Devshed Novice (500 - 999 posts)

    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    886
    Rep Power
    321
    I have multiple include *.js files in a site and Mozilla handles it no problem.. some of the functions do indeed call functions from other includes.

    Maybe something to do with the order of your functions or conditional statements?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    7
    Rep Power
    0
    I am not really sure what was wrong, but I started copying one function at a time from the JavaScript file that was causing problems into another one, and now it seems to be working fine. I am assuming that I changed something in the script as I was copying and cleaning up that fixed the problem.

    Thanks! It was good to know that at least it wasn't a strange bug in Mozilla.

    BTW, do you know if it is possible to have scrolling layers in Mozilla? IE, I know, supports this feature, but Mozilla does not recognize the syntax.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    7
    Rep Power
    0
    Well, it appears that with Mozilla if there are any errors in the JavaScript for a particular include, none of the functions will execute within that file. (IE will still execute the code until an error is encountered) This is made worse in that there is no notification that the error does in fact exist.

    Khomar

IMN logo majestic logo threadwatch logo seochat tools logo