By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,524 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

javascript and php

P: n/a
function switchColors(element, color)
{
links=document.getElementsByTagName("a") ;
for (var i = 0 ; i < links.length ; i ++)
links.item(i).style.color = 'blue' ;

element.style.color=color ;
}

I have an echo php link with a javascript mouseout, why doesnt this work?

<a href=\"$PHP_SELF?action=list_records&amp;cur_page= $varray&id=$id\"
onmouseout=javascript:switchColors(this, 'yellow')> $array </a></td>";
Irlan
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Irlan agous wrote:
I have an echo php link with a javascript mouseout, why doesnt this work?
<a href=\"$PHP_SELF?action=list_records&amp;cur_page= $varray&id=$id\" onmouseout=javascript:switchColors(this, 'yellow')> $array

</a></td>";

Perhaps a couple reasons - try this:
onmouseout="switchCo*lors(this, 'yellow')"
(no javascript: and the onmouseout value is in quotes

Jul 17 '05 #2

P: n/a
Its not working, i tried it. I get the error message

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in
/home/httpd/resultaattest.php on line 196

"BKDotCom" <bk***********@yahoo.com> schreef in bericht
news:11**********************@g14g2000cwa.googlegr oups.com...

Irlan agous wrote:
I have an echo php link with a javascript mouseout, why doesnt this work?
<a href=\"$PHP_SELF?action=list_records&amp;cur_page= $varray&id=$id\" onmouseout=javascript:switchColors(this, 'yellow')> $array

</a></td>";

Perhaps a couple reasons - try this:
onmouseout="switchCo*lors(this, 'yellow')"
(no javascript: and the onmouseout value is in quotes
Jul 17 '05 #3

P: n/a
Irlan agous <ir******@msn.com> wrote:
Its not working, i tried it. I get the error message

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in
/home/httpd/resultaattest.php on line 196


Please don't multipost (nl.comp.programmeren (where you got the same
(syntactically) correct answer)
Please don't TOFU.

Ploink anyway since this is the second time.

Jul 17 '05 #4

P: n/a
Irlan agous wrote:
Its not working, i tried it. I get the error message

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in
/home/httpd/resultaattest.php on line 196


Now that one is a PHP error... try escaping your double quotes...

onmouseout=\"switchCo*lors(this, 'yellow')\"

--
Justin Koivisto - ju****@koivi.com
http://koivi.com
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.