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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Weird characters on mouseover

    I have a mouseover link script below that works in Netscape 4.77 and IE. It is suppose to go over the link and show a small box with text info about the link. It does work but after it goes over the link and shows the text info about link it makes ALL words on the Netscape 4.77 web page all look like weird squares. It works great in IE. Please advise where I can correct this problem. I think I know where the problem is but can figure out how to fix it?

    Code:
    <DIV ID="tooltip" STYLE="position:absolute;visibility:hidden;"></DIV>
    <script language="JavaScript1.2" type="text/javascript">
    	if (!document.layers&&!document.all)
    	event="test"
    	function showtip(current,e,text,orientation) { 
                    if (document.all) {
    		thetitle=text.split('<BR>')
    		if (thetitle.length > 1) {
    		thetitles=''
                     for (i=0;i<thetitle.length;i++)	
    thetitles+=thetitle[i]
    current.title=thetitles
    	}
    	else {
    	        current.title=text
    	}
    	} else if (document.layers) {  //HERE AND BELOW IS WHERE THE PROBLEM SEEMS TO BE IN NETSCAPE 
    document.tooltip.document.write('<strong>'+text+'</strong>')
    document.tooltip.document.close()
    if (orientation == "right") {
    document.tooltip.left=e.pageX+10
    document.tooltip.top=e.pageY+10
    			} else {
    document.tooltip.left=e.pageX-5
    document.tooltip.top=e.pageY-5
    			}
    	document.tooltip.zIndex=1000  
    document.tooltip.visibility="show"
    		}
    	}
    	function hidetip() {		
    		if (document.layers) {
    		document.tooltip.visibility="hidden"
    		}
    	}
    if (top.frames.length!=0)
    top.location=self.document.location;
    </script>

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I forgot to say I dont have any frames in this page and it is an HTML page.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Squares in place of characters usually indicates a problem with the font family not supporting the particular characters being used. Try changing the specification for the font family.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I got rid of all fonts and it still does it. Anymore advise?

    thanks

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    What exactly is the value of the text parameter passed to the showtip() function?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is how it is called in my mouseover and mouseout:

    Code:
    <TABLE border="1" width="99%" align="center">
    	
    <tr>
    <TD width="21%" ><A HREF="chec.cfm"  TARGET="self" onMouseOver="showtip(this,event,'VALUE OF TEXT','right');return true" 
    onMouseOut="hidetip();" TITLE="This event handler provides an popup message.">ATL</A></TD>
    <TD align="middle" width="7%" >test</TD>
    	
    	</tr>	
    </table>

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It works fine (no strange block characters) in Netscape 4.75 (which is what I use for testing NS 4).

    Here's the whole sample page I put it in (where it worked). Try it with your system, so we can narrow this down a bit:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    	<head>
    		<title>Testing</title>
    		<script language="JavaScript1.2" type="text/javascript">
    			if (!document.layers&&!document.all)
    			event="test"
    			function showtip(current,e,text,orientation) { 
    		                if (document.all) {
    				thetitle=text.split('<BR>')
    				if (thetitle.length > 1) {
    				thetitles=''
    		                 for (i=0;i<thetitle.length;i++)	
    		thetitles+=thetitle[i]
    		current.title=thetitles
    			}
    		else {
    		        current.title=text
    			}
    			} else if (document.layers) {  //HERE AND BELOW IS WHERE THE PROBLEM SEEMS TO BE IN NETSCAPE 
    				document.tooltip.document.write('<strong>'+text+'</strong>')
    				document.tooltip.document.close()
    				if (orientation == "right") {
    				document.tooltip.left=e.pageX+10
    				document.tooltip.top=e.pageY+10
    							} else {
    				document.tooltip.left=e.pageX-5
    				document.tooltip.top=e.pageY-5
    							}
    					document.tooltip.zIndex=1000  
    				document.tooltip.visibility="show"
    						}
    					}
    					function hidetip() {		
    						if (document.layers) {
    						document.tooltip.visibility="hidden"
    						}
    					}
    				if (top.frames.length!=0)
    				top.location=self.document.location;
    		</script>
    	</head>
    	<body>
    		<DIV ID="tooltip" STYLE="position:absolute;visibility:hidden;"></DIV>
    		<TABLE border="1" width="99%" align="center">		
    			<tr>
    				<TD width="21%" >
    					<A HREF="chec.cfm"  TARGET="self" onMouseOver="showtip(this,event,'VALUE OF TEXT','right');return true" 
    					onMouseOut="hidetip();" TITLE="This event handler provides an popup message.">ATL</A>
    				</TD>
    				<TD align="middle" width="7%" >
    					test
    				</TD>
    			</tr>	
    		</table>		
    	</body>
    </html>
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Originally posted by florida
    Here is how it is called in my mouseover and mouseout:

    Code:
    <TABLE border="1" width="99%" align="center">
    	
    <tr>
    <TD width="21%" ><A HREF="chec.cfm"  TARGET="self" onMouseOver="showtip(this,event,'VALUE OF TEXT','right');return true" 
    onMouseOut="hidetip();" TITLE="This event handler provides an popup message.">ATL</A></TD>
    <TD align="middle" width="7%" >test</TD>
    	
    	</tr>	
    </table>
    Is that the actual text passed? That should definitely work, as Roy tested.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #9
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks and I see if works as an HTML page but unfortunately this is a Cold Fusion page and it gives the weird characters on my Cold Fusion MX web page. I tried changing the content="text/cfm; charset=iso-8859-1 but it still gives weird characters in my Netscape 4.77 browser. Any suggestions on what else I could try??

    Thanks again!

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Shouldn't you be outputting "text/htm" to the browser? If shouldn't know anything about "text/cfm".
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #11
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually I just tested "text/html" and I tested "text/htm" and what I posted was just another attempt to get it to work in cfm so I tested "text/cfm". All still gave me the weird characters in my Cold Fusion MX page in Netscape 4.77. Any other suggestions??

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try doing a view-source on the output web page and then cut and past that into a text file. See if the problem still exists in the text file copy.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #13
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I copied source and put it in text file and then copied it back to server and it still shows weird characters. Any other suggestions??

  • #14
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since you can reproduce it using a static web page instead of always involving Cold Fusion then it's time to look at the static code it's generating.

    Try simply deleting various parts of the static web page to see whether you can narrow the problem down to a small part of the page. If it's not too proprietary (or too large) you could even post the static html here so more people could look at it and help in finding the offending code.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #15
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Roy,

    Thanks for all your help on this. I still got weird characters using the JavaScript you had in an earlier reply (see below JavaScript). I will just have to keep working at it. Again thanks for all your time and help!!

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                                  <html>
                                          <head>
                                                  <title>Testing</title>
                                                  <script language="JavaScript1.2" type="text/javascript">
                                                          if (!document.layers&&!document.all)
                                                          event="test"
                                                          function showtip(current,e,text,orientation) { 
                                                                  if (document.all) {
                                                                  thetitle=text.split('<BR>')
                                                                  if (thetitle.length > 1) {
                                                                  thetitles=''
                                                                   for (i=0;i<thetitle.length;i++)        
                                                  thetitles+=thetitle[i]
                                                  current.title=thetitles
                                                          }
                                                  else {
                                                          current.title=text
                                                          }
                                                          } else if (document.layers) {  //HERE AND BELOW IS WHERE THE PROBLEM SEEMS TO BE IN NETSCAPE 
                                                                  document.tooltip.document.write('<strong>'+text+'</strong>')
                                                                  document.tooltip.document.close()
                                                                  if (orientation == "right") {
                                                                  document.tooltip.left=e.pageX+10
                                                                  document.tooltip.top=e.pageY+10
                                                                                          } else {
                                                                  document.tooltip.left=e.pageX-5
                                                                  document.tooltip.top=e.pageY-5
                                                                                          }
                                                                          document.tooltip.zIndex=1000  
                                                                  document.tooltip.visibility="show"
                                                                                  }
                                                                          }
                                                                          function hidetip() {            
                                                                                  if (document.layers) {
                                                                                  document.tooltip.visibility="hidden"
                                                                                  }
                                                                          }
                                                                  if (top.frames.length!=0)
                                                                  top.location=self.document.location;
                                                  </script>
                                          </head>
                                          <body>
                                                  <DIV ID="tooltip" STYLE="position:absolute;visibility:hidden;"></DIV>
                                                  <TABLE border="1" width="99%" align="center">           
                                                          <tr>
                                                                  <TD width="21%" >
                                                                          <A HREF="chec.cfm"  TARGET="self" onMouseOver="showtip(this,event,'VALUE OF TEXT','right');return true" 
                                                                          onMouseOut="hidetip();" TITLE="This event handler provides an popup message.">ATL</A>
                                                                  </TD>
                                                                  <TD align="middle" width="7%" >
                                                                          test
                                                                  </TD>
                                                          </tr>   
                                                  </table>                
                                          </body>
                                  </html>


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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