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

easy syntax question....

P: n/a
Hi,

why is it ok to have:

function home_mouseover(){
document.getElementById("hom").src = home_night.src;
}

<a href="./home.shtml" onmouseover="home_mouseover();">

but not ok (results in a syntax error) to have:

<a href="./home.shtml" onmouseover="document.getElementById("hom").src =
home_night.src;">

aren't these the same?

Thanks for your help.

Michael
Oct 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Michael wrote:
Hi,

why is it ok to have:

function home_mouseover(){
document.getElementById("hom").src = home_night.src;
}

<a href="./home.shtml" onmouseover="home_mouseover();">

but not ok (results in a syntax error) to have:

<a href="./home.shtml" onmouseover="document.getElementById("hom").src =
home_night.src;">

aren't these the same?
Both HTML and JavaScript use " to quote. You have to straighten that out.
--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
Oct 1 '06 #2

P: n/a

"John W. Kennedy" <jw*****@attglobal.netwrote in message
news:DW*************@newsfe10.lga...
Michael wrote:
>Hi,

why is it ok to have:

function home_mouseover(){
document.getElementById("hom").src = home_night.src;
}

<a href="./home.shtml" onmouseover="home_mouseover();">

but not ok (results in a syntax error) to have:

<a href="./home.shtml" onmouseover="document.getElementById("hom").src =
home_night.src;">

aren't these the same?

Both HTML and JavaScript use " to quote. You have to straighten that out.
--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
Thanks for that :-)
Oct 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.