Jump to content

Okay, what's wrong here?


SmokingMan
 Share

Recommended Posts

I have a simple script to display the title of the link in the status bar instead of the URL. It's just a cleaner way for people to see where they're linking to. It works on other sites but for some reason not on this particular one. The only real difference is that this site's pages have .php extensions since I use PHP to include a menu.Here's the link code:

<a class="gallery-link" href="missy-slideshow.html" onmouseout="return addressMsg('')" onmouseover="return addressMsg('Missy's Slideshow')">here</a>

And here's the script:

function addressMsg(addrMsg)	{	window.status = addrMsg;	return true;}

It should work. Is there something I'm missing here? I've looked at it for so long now I'm going cross-eyed :)

Link to comment
Share on other sites

onmouseover="return addressMsg('Missy's Slideshow')"
It's not working because of the single quote in Missy's, it thinks it the end of the line.escape the character and it should work just fine :)
onmouseover="return addressMsg('Missy\'s Slideshow')"

Link to comment
Share on other sites

I have removed the apostrophe and tried the "\'" instead, and neither work. I still get the entire URL path instead of the message. Here's a link to the page so you can see the source.

Link to comment
Share on other sites

ok, this works

<head><script>function addressMsg(addrMsg) {window.status = addrMsg;return true;}</script></head><body><a class="gallery-link" href="missy-slideshow.html" onmouseout="return addressMsg('')" onmouseover="return addressMsg('Missy\'s Slideshow')">here</a></body>

and more simply (no function required)

<a class="gallery-link" href="missy-slideshow.html" onmouseout="window.status='';return true;" onmouseover="window.status='Missy\'s Slideshow';return true;">here</a>

Link to comment
Share on other sites

Well...the first example still didn't work, but the second one does. I don't understand why all of the problems with this page when I use it on other pages with no problem. Oh well :) I do thank you for your help and patience.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...