onmouseover problem

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
antas
Forum Newbie
Posts: 6
Joined: Mon Apr 14, 2003 7:41 pm

onmouseover problem

Post by antas »

how can I do to eliminate the link that appears on the status bar when the mouse is on one of the links printed wiht this echo?
I have something like this:

echo "<a href='download.php?file=$dfile' target='_blank'>File</a><br>;"
I tried a lot of things, but unsuceccsfuly.
thakns
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You can't solve this with PHP - this is a JavaScript problem - so I've moved it to the Client Side forum.

Why don't you post what you've tried so that those more JavaScript inclined can help you sort the problem.

Mac
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Try

Code: Select all

echo "<a href='download.php?file=$dfile' target='_blank' window.status='This is a link to $dfile'>File</a><br>;"
window.status displays the text specified in the window status-bar.
?>
antas
Forum Newbie
Posts: 6
Joined: Mon Apr 14, 2003 7:41 pm

Post by antas »

still nothing! :(
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Gah, still hung over from last night.

Do it like this:

<a href='download.php' target='_blank' onMouseOver="status='This is a link to me'; return true;" onMouseOut="status='This was nada'">blalalal</a>
antas
Forum Newbie
Posts: 6
Joined: Mon Apr 14, 2003 7:41 pm

Post by antas »

Parse error: parse error, unexpected T_STRING, expecting ',' or ';'
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

I pasted HTML, not PHP. Escape the double-quotes " with \" when you echo them.

Code: Select all

<?php
echo "

<a href='download.php' target='_blank' onMouseOver="status='This is a link to me'; return true;" onMouseOut="status='This was nada'">blalalal</a>
"
?>
Now I am off to bed again and cure my hang-over.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

forgot the bloody semi-colon at the end of the echo.

;
antas
Forum Newbie
Posts: 6
Joined: Mon Apr 14, 2003 7:41 pm

Post by antas »

Thank You very much!
I't worked great! :))
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

I cannot test this but I am pretty sure that you could do it this way:

echo <<<LINK
<a href="link.php?var=varData" onMouseover="window.status='Ding Dong'; return true" onMouseout="window.status=' '; return true">Link</a>
LINK;

I find this much easier, but that is just personal oppinion.

Tell me if it works?
Post Reply