Web Analytics Made Easy -
StatCounter Max length of js-files? - CodingForum


No announcement yet.

Max length of js-files?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Max length of js-files?

    I have got a weird problem... It seems like my js-file, which is included in a popup, is cut off before it has been fully loaded. What could be the problem???

    The error message I'm receiving when loading the popup-window is "Row x Char y 'funct is undefined' - but there is only functIONS in my js-file!

  • #2
    I guess "funct" is an abbreviation of "function"... Can you offer people a look at your script, and maybe a URL to your page(s)? Without being able to see what you have it's practically impossible to give concrete advise.


    • #3
      Sorry, I will try to describe my problem better...

      Obviously the included javascript file is being cutoff when it is parsed, since the error message only says "funct is undefined" instead of "function"...! (There is no "funct" in the code! Do you think the error message has abbreviated "function"?!) Earlier I got the error "Line x character y '}' is missing" but there was no such error in the code. During my search I've come to the conclusion that the parser is stopping in the middle of the file, which also explains why it thought a bracket was missing when it was not... I guess there is a limit or something of how large one include file can be? This one has about 2200 lines and about 150 functions in it. Is that too much?

      Please, help!


      • #4
        Too much?

        Too much is not usually a problem in programming, but if it returns "funct" I'd say that your browser either ran out of cache or memory, or you put a space in accidentaly, but you might not find the space very obvious, so I (personally) suggest that you do two things:

        1) open up your *.js file and do a search for "funct", or "funct ",
        and if you find it, try loading again (after saving of course)
        2) break up your *.js file and categorize or link seperately.

        Last edited by Guardian23; Jul 4, 2002, 09:28 AM.


        • #5
          What are you trying to accomplish with that script?!! I guess it's rather big, and am curious about load and execution times anyway! I really wouldn't know if there's a limit to how big a page can be, but it looks like you found it (the limit, that is).


          • #6
            ..hmmm.. I'm curious how big the js file is...

            ..also, if it does run out of memory or gets to "some other size limit" it should error when that size is reached. Add some code in the begining of the script and see if it errors in a different place other than funct.....
            Vladdy | KL
            "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


            • #7
              Thank's for the answers!

              The problem disappeared when I split the file into separate include-files. It seems that the file was too large - but the question is why this happens only in some occasions? The same large include-file is included in almost all of my html-pages, but the problem only appeares in a few occasions... Perhaps it has something to do with different loading times...?

              Well, the problem is solved for now!