SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Done, but with errors on page

    Hi,

    I'm having this problem on my pages and when I double click the error at the bottom left corner it says:
    Line: 3
    Char: 10
    Error: Expected ';'
    Code: 0

    Line 3 is my charset line and its setting perfectly like this:
    Code:
     <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    Any idea folks?

    TIA

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2003
    Location
    USA
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure what is wrong, but I know this line works:

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">

    Can you post more of your code? Maybe the error is right before or after this.
    Last edited by Redhat_PHP; Oct 14, 2003 at 14:08.
    .
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

  3. #3
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suspect it's a javascript error, not least because javascript errors often end up with horribly-mangled line numbers in the error message, which point at COMPLETELY the wrong bit of code. Can we see the whole page?

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    blufive is right, it's a Javascript error. You're missing a semicolon somewhere to terminate your statement. Check your scripts (and any scripts included with <script src="">) and make sure the statement is ended properly.

  5. #5
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I have between in the header:

    Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <title></title>
    <LINK REL=STYLESHEET TYPE="text/css" HREF="sap/sapstyle.css">
    <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
    <!--
     // HierMenus Init
     if(window.event + "" == "undefined") event = null;
     function HM_f_PopUp(){return};
     function HM_f_PopDown(){return};
     popUp = HM_f_PopUp;
     popDown = HM_f_PopDown;
     HM_DOM = (document.getElementById) ? true : false;
     HM_NS4 = (document.layers) ? true : false;
     HM_NS4old = (HM_NS4 && (parseFloat(navigator.appVersion) < 
    4.02));
     HM_IE = (document.all) ? true : false;
     HM_IE4 = HM_IE && !HM_DOM;
     HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
     HM_Unix = (navigator.appVersion.indexOf("X11") != -1);
     HM_IE4M = HM_IE4 && HM_Mac;
     HM_IsMenu = (HM_DOM || (HM_NS4 && !HM_NS4old) || (HM_IE && !HM_IE4M));
     //-->
    </SCRIPT>
    <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
     <!-- 
     // Global Nav Position
     var menuWidth = 130;
     var topPosition = 137;
     var button_spacing = 116;	 
    		   var ActiveLanguage = "";
     //-->
    </SCRIPT>
    <script language="JavaScript" TYPE="text/javascript" src="sap/top_nav_items.js"></script>
    </head>

  6. #6
    SitePoint Evangelist ucahg's Avatar
    Join Date
    Apr 2001
    Location
    Sarnia, Ontario, Canada
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function HM_f_PopDown(){return};

    You don't neeed a semicolon here, FYI, but that shouldn't be your problem. Does it say the location of the file giving the error?

    I except it is your included .js file, for that would explain the otherwise strange line number.
    Love it? Hate it? Helpful? Useless?
    Use the rate button to let me know what you think of my post!

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by ucahg
    function HM_f_PopDown(){return};

    You don't neeed a semicolon here, FYI, but that shouldn't be your problem. Does it say the location of the file giving the error?

    I except it is your included .js file, for that would explain the otherwise strange line number.
    Actually, that function should look more like this:
    Code:
    function HM_f_PopDown() { return; }
    Note that the semicolon is after the "return" statement, not after the closing bracket of the function.

  8. #8
    SitePoint Evangelist ucahg's Avatar
    Join Date
    Apr 2001
    Location
    Sarnia, Ontario, Canada
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    However in javascript semicolons are not mandatory, and it is perfectly valid without any semicolons except in the case of very rare conditions.

    I usually wouldn't skimp out on the semicolon though, as I personally think it makes the script much more readable, but in a case where a closing bracket immediately follows the statement, I might omit it.
    Love it? Hate it? Helpful? Useless?
    Use the rate button to let me know what you think of my post!

  9. #9
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The error is most likely in sap/top_nav_items.js
    ck :: bringing chris to the masses.

  10. #10
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function HM_f_PopDown() { return; }
    However in javascript semicolons are not mandatory, and it is perfectly valid without any semicolons except in the case of very rare conditions
    I think this might be one of those conditions.

    In any case, can we also see this file:
    Code:
    <script language="JavaScript" TYPE="text/javascript" src="sap/top_nav_items.js"></script>
    Or, even better, the whole page?

  11. #11
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    top_nav_items is fine I just checked it (file attached)
    Attached Files Attached Files

  12. #12
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then you need to post a link so that we can see the whole page and figure out what's going on.
    ck :: bringing chris to the masses.

  13. #13
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  14. #14
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah that makes it much easier to find the problem. It also helps that I'm using mozilla, which gives clear descriptions of javascript errors and the context.

    Here's the error:

    Error: invalid label
    Source File: http://sap.com/global/client_functions.js
    Line: 2, Column: 9
    Source Code:
    Ref1=http://sap.com/global/client_functions.js?MSWMExt=.asf

    On line 47 of your html file you have this code:
    <script LANGUAGE="JavaScript1.2" SRC="http://sap.com/global/client_functions.js" TYPE='text/javascript'></SCRIPT>

    However, the file is actually some weird type of video file, possibly exploiting a bug in windows media player. Downloading it shows that it contains this text, which is certainly not javascript:

    [Reference]
    Ref1=http://sap.com/global/client_functions.js?MSWMExt=.asf
    Ref2=http://204.154.71.136:80/global/client_functions.js?MSWMExt=.asf
    ck :: bringing chris to the masses.

  15. #15
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Anarchos

    client_function.js is not even on the server, so I went ahead and omitted line 47, error is GONE!

    it was included there because its from the original SAP.com code and we have to follow their design.

  16. #16
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just so you know, Opera supports document.all, so it will get sent to your IE code. This is a terrible way to do browser checking. I don't know it you can in JS, but it would be better to just parse the User-Agent header.
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor


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
  •