JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 14th, 2000, 02:02 PM
aarongb aarongb is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 60 aarongb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Howdy all.
It's Friday, X-Men opens tonight and I can't think straight. So I need a little help.

I have the following code in a page to display an "onmouseovered" link if a certain var is true in a table.

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><?if ($phorum=='yes') {
echo "<a href='../phorum/list.php4?appno=$appno&entity=$entity&password=$password&num=$phorum_id' onMouseOut='MM_swapImgRestore()' onMouseOver='MM_swapImage('document.messageboard','document.messageboard','../images/on_mssgboard.jpg','#955986178380')'><img name='messageboard' border='0' src='../images/off_mssgboard.jpg' width='173' height='16'></a>";
}
?>[/code]

Because of the way PHP handles single and double quotes, it needs to appear like this in PHP, BUT, the mouseover won't work because the javascript code needs to appear like this to do a mouseover (note the single/double quotes):

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre><a href="../phorum/list.php4?appno=11355&entity=2000&password=test&num=1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('document.messageboard','document.messageboard','../images/on_mssgboard.jpg','#955986178380')"><img name="messageboard" border="0" src="../images/off_mssgboard.jpg" width="173" height="16"></a>[/code]

Anyone have a clue as to how I can fix this? The mouseover has become a "selling feature" (go figure.) but I am very willing to trash it if it can't be done.

Reply With Quote
  #2  
Old July 14th, 2000, 02:34 PM
scollo scollo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 1999
Posts: 114 scollo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 42 m 44 sec
Reputation Power: 10
Use a backslash to escape your nested quotes:

$sAlert = "alert ("Hi");";

Reply With Quote
  #3  
Old July 14th, 2000, 07:40 PM
phlyingpenguin phlyingpenguin is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Posts: 1 phlyingpenguin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Have you thought to ESCAPE IT!? You use yes thats right to escape quotes!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > PHP/Javascript problems!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway