|
-
May 11th, 2001, 04:54 AM
#1
Thread Starter
Addicted Member
response write a javascript
currently i have this line in html using javascript
<div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image32','','search1.gif',1)"><img name="Image32" border="0" src="search.gif" width="98" height="31"></a></div>
i want to do an if statment
if strname <> "" then
response.write the above html/javascript
else
response.write "you are not logged in"
end if
if i do response.write "<div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image32','','search1.gif',1)"><img name="Image32" border="0" src="search.gif" width="98" height="31"></a></div>"
i get errors saying end of statment expected and stuff
any suggestions
cheers
-
May 11th, 2001, 05:46 AM
#2
Lively Member
brackets
round ones that is.
i.e.
response.write ("<div align="center">...yadda yadda yadda </div>")
also dont u need the semi colons after the javascript statements?
;
You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!
-
May 11th, 2001, 06:30 AM
#3
Proberly because your using " within ". Try using single ' within double ".
Code:
response.write "<div align='center'><a href='#' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage('Image32','','search1.gif',1)'><img name='Image32' border='0' src='search.gif' width='98' height='31'></a></div>"
-
May 11th, 2001, 02:14 PM
#4
Thread Starter
Addicted Member
nope i have tried both ways and neither of them work
any more suggestions guys
-
May 11th, 2001, 04:33 PM
#5
Lively Member
try both
Try using both "round" brackets (nice way of putting it) and single quotes.
-
May 13th, 2001, 05:44 AM
#6
Frenzied Member
your problem lies here:
onMouseOver='MM_swapImage('Image32','','search1.gif',1)'
you need it to be:
onMouseOver="MM_swapImage('Image32','','search1.gif',1)"
Try this...
response.write "<div align='center'><a href='#' onMouseOut='MM_swapImgRestore()' onMouseOver=" & chr(34) & "MM_swapImage('Image32','','search1.gif',1)" & chr(34) & "><img name='Image32' border='0' src='search.gif' width='98' height='31'></a></div>"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|