Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > easy syntax question....

Reply
Thread Tools

easy syntax question....

 
 
Michael
Guest
Posts: n/a
 
      10-01-2006
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


 
Reply With Quote
 
 
 
 
John W. Kennedy
Guest
Posts: n/a
 
      10-01-2006
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"
 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      10-01-2006

"John W. Kennedy" <(E-Mail Removed)> wrote in message
newsWHTg.78$(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it reasonably easy easy to something like this with python? Bruno Desthuilliers Python 5 08-29-2007 07:40 AM
Stripping audio from qa DVD. Easy or not so easy? GJ Computer Support 1 05-23-2007 02:03 AM
easy to look at and easy to maintain web page menuing system. Hazzard ASP .Net 2 04-06-2004 03:51 AM
easy syntax q: for each record in recordset Ken Fine ASP General 5 11-28-2003 05:22 PM



Advertisments