Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Javascript not working in FF or IE-Chrome works fine.


  • Please log in to reply
4 replies to this topic

#1 samlf3rd

samlf3rd

  • Members
  • 72 posts
  • OFFLINE
  •  
  • Local time:11:52 AM

Posted 04 May 2010 - 07:43 PM

Hello Bleeping Computer GURU,

Hopefully someone can figure out my mess (I thank you all in advance).

The page (http://pagepopwebdesign.com/Urbanfiles/properties.html) contains Javascript that when you hover over a "state name" locations pop-up on the right ( the text changes on the right-hand side).
This works great in Google Chrome, but it will not work in IE8 or FireFox. Does anyone know why? Is there a better code that will work in all browsers or just another way to achieve this function?
Here is the code I used in the head: (Sorry for all the spaces-needed them to align properly)

[codebox]<script LANGUAGE="JavaScript">

<!-- Begin
var description = new Array();
description[0] = "Northwest Arkansas Mall*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fayetteville&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AR";
description[1] = "The Citadel*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Colorado Springs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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;&nbsp;&nbsp;&nbsp;MI";
// End -->
</script>


And the code in the table is:
<table width="1029" border="0" align="center">
<tr>
<td width="1023" height="389" align="right" valign="top" id="body2"><table width="1000" height="358" border="0" cellpadding="5" cellspacing="5" id="services_text">
<tr>

<td height="46" valign="middle">&nbsp;</td>
<td width="127" align="left" valign="bottom">Property</td>
<td width="104" align="left" valign="bottom">City</td>
<td width="65" align="left" valign="bottom">State</td>
</tr>
<tr>
<td width="639" rowspan="9" valign="top"><table width="500" border="0">

<tr>
<td colspan="2"><ul>
<li><a onMouseOver="Words.innerHTML = description[0];" href="link1.htm">Arkansas</a>
<li><a onMouseOver="Words.innerHTML = description[1];" href="link2.htm">Colorado</a>
<li><a onMouseOver="Words.innerHTML = description[2];" href="http://www.kipcug.org" target="_blank">Ohio</a>
<li><a onMouseOver="Words.innerHTML = description[3];" href="http://www.kipcug.org" target="_blank">Indiana</a>
<li><a onMouseOver="Words.innerHTML = description[4];" href="http://www.kipcug.org" target="_blank">Illinois</a>
<li><a onMouseOver="Words.innerHTML = description[5];" href="http://www.kipcug.org" target="_blank">Michigan</a>
</ul></td>

<td width="195" valign="top">&nbsp;</td>
<td width="195">&nbsp;</td>
</tr>
</table>
</td>
<td height="42" colspan="3" valign="top">
<!-- Cell with the descriptions -->
<a id="Words">Please chose a state on the left to see a list of our properties in that area.</a> </td>
</tr>
<tr>

<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>

<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>

<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td height="26" colspan="4"> <h5>&nbsp;</h5></td>
</tr>

</table></td>
</tr>
</table>
[/codebox]



Again thank you, and if you know another way this can be achieved please let me know!

Edited by Andrew, 05 May 2010 - 01:54 PM.


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:52 AM

Posted 04 May 2010 - 07:55 PM

Here is our problem. You didn't ask a question. You didn't tell us what you wanted to happen. You didn't tell us what really happened. you didn't give us a link to show us what you are describing. You didn't use code tags in your post. You didn't tell us your problem.

#3 samlf3rd

samlf3rd
  • Topic Starter

  • Members
  • 72 posts
  • OFFLINE
  •  
  • Local time:11:52 AM

Posted 04 May 2010 - 08:47 PM

Groovicus, in Google chrome when you visit (http://www.pagepopwebdesign.com/Urbanfiles/properties.html) I have links on the left (over the map) that are states. When you hover over them they will change the text on the right. Well it is only working with Chrome-fails to work in IE8 and FireFox. The page is an HTML page with the java script added to the head and then to the body in the <td>.

#4 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:10:52 AM

Posted 04 May 2010 - 10:55 PM

Make a function like this :
function change(id){
	document.getElementById("Words").innerHTML = description[id];
}
Then in links section do something like this :
<li><a onMouseOver="change(0);" href="link1.htm">Arkansas</a>
<li><a onMouseOver="change(1);" href="link2.htm">Colorado</a>


#5 samlf3rd

samlf3rd
  • Topic Starter

  • Members
  • 72 posts
  • OFFLINE
  •  
  • Local time:11:52 AM

Posted 05 May 2010 - 12:37 AM

Thanks Romeo awesome script! I have been looking for this script for a long time-I was beginning to think it was done in flash only. It worked very well in all browsers, and sorry I really don't have much javascript experience-still attending Devry-haven't gotten that far yet!

Thanks again!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users