Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Strange explorer bug that hangs javascript

    Hi all,

    I found a strange explorer bug (I'm using version 6) that if it finds a plus sign with some text imediately after it, on some machines it present it as some japanese characters and keep looping javascript loops forever.

    For example:

    Code:
    <html>
    <head>
      <SCRIPT LANGUAGE="JavaScript">
    	//+-+-+-+-+-+-+-+-+-+-+-+-+for highlight row+-+-+-+-+-+-+-+-+-+-+-+-+//
    	function test(){  
    		for (i=0;i<3;i++) {
    			alert(i);
    		}		
    	}
    </SCRIPT>
    </head>
    
    <body>
    	This is a mystery: 
    	+jkshdfjsdh
    	<br>
    	<table>
    		<tr onclick="test();">
    			<td>
    				<b>click here...</b>
    			</td>
    		</tr>
    	</table>
    </body>
    </html>
    produces a garbeled display with some japanese characters, and it does not increment the i variable in the loop so it loops forever!

    It also happen in a middle of a javascript comment stating with //

    If I put just a space after the '+' then it works fine.

    Anybody has a clue?

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jbrnra
    I found a strange explorer bug (I'm using version 6) that if it finds a plus sign with some text imediately after it, on some machines it present it as some japanese characters and keep looping javascript loops forever.

    Anybody has a clue?

    didn't do it for me!
    *keep it simple (TM)

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    The mistery lays in the absence of the doctype and the necessary meta tags.

    if you have had correctly coded, there would have not been any mistery at all:
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <
    html>
    <
    head>
    <
    title>Untitled Document</title>
    <
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <
    meta http-equiv="Content-Style-Type" content="text/css">
    <
    meta http-equiv="Content-Script-Type" content="text/javascript">
    <
    script language="JavaScript" type="text/JavaScript">
    function 
    test(){  
            for (var 
    i=0;i<3;i++) {
                
    alert(i);
            }        
        }
    </script>
    </head>
    <body>
        This is a mystery: 
        +jkshdfjsdh
        <br>
        <table>
            <tr onclick="test();">
                <td>
                    <b>click here...</b>
                </td>
            </tr>
        </table>
    </body>
    </html> 
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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