Reply
How to display html in javascript without canceling out specific tags?
Old 04-26-2008, 05:58 PM How to display html in javascript without canceling out specific tags?
Sydpix's Avatar
Ultra Talker

Posts: 326
Name: Denny
Location: In a can...
I am using a javascript mouse over. The inner content displays html but I have to cancel out specific tags and ' with a \.

Does anyone have any suggestions how I could do an SSI through javascript that would allow me to include any HTML ?

For instance:

Instead of this mess:

Code:
<img src="images/barn_2_draft.gif" alt="#" title="The Gable" width="115" height="86"
onmouseover=
"Tip('&lt;div id=\'box_1\'&gt;&lt;img src=images/Barns/barn_2.gif width=145 height=110 &gt;&lt;\/div&gt;&lt;div id=\'box_2\'&gt;&lt;strong&gt;The Gable features &lt;\/strong&gt;a standard 6\' tall wall and an over sized top plate for additional overhang. With its classic styling this building offers a great balance between tall walls and a lower overall height.<br \/><br \/><br \/>&lt;\/div&gt;&lt;div id=\'box_3\'&gt;&lt;img src=images/Barns/barn_1.gif width=145 height=110 &gt;&lt;\/div&gt;&lt;div id=\'box_4\'&gt;The six foot sidewall building offers maximum storage on walls and overhead. This building is the most cubic foot building for the dollar. You can never go wrong with a tall sidewall barn. We also offer optional lofting and shelving to help maximize your space.&lt;\/div&gt;', HEIGHT, 125, WIDTH, 380, TITLE, 'The Gable', TITLEFONTSIZE, '13pt', FADEIN, 200, FADEOUT, 300, CLOSEBTN, true,  STICKY, true)"
onmouseout="UnTip()" />
With something a little easier like this with an included HTML page:

Code:
<img src="images/barn_2_draft.gif" alt="#" title="The Gable" width="115" height="86"
onmouseover=
"Tip('<?php include("includes\/1.htm"); ?>;', HEIGHT, 125, WIDTH, 380, TITLE, 'The Gable', TITLEFONTSIZE, '13pt', FADEIN, 200, FADEOUT, 300, CLOSEBTN, true,  STICKY, true)"
onmouseout="UnTip()" />
The problem, I think, is parsing the HTML through javascript?
__________________
Man... IE stinks ... and If I get one more contingency offer!!! **Sydpixel**
Sydpix is offline
Reply With Quote
View Public Profile Visit Sydpix's homepage!
 
Sponsored Links (We share ad revenue):
 
Old 04-27-2008, 03:05 AM Re: How to display html in javascript without canceling out specific tags?
chrishirst's Avatar
Super Moderator

Posts: 10,598
Location: Blackpool. UK
Not using an include but this thread may help
http://www.webmaster-talk.com/html-f...tml#post295089

earlier in the thread are ASP and PHP functions to do the same kind of thing
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-27-2008, 08:03 AM Re: How to display html in javascript without canceling out specific tags?
Sydpix's Avatar
Ultra Talker

Posts: 326
Name: Denny
Location: In a can...
Thanks for that Chris.

What I think I need is something like this
http://us3.php.net/preg_replace

I'm trying to cancel the need for the cancel if that makes any sense? I would like to use ANY html inside and php include. Is this possible without converting to php?

With this, I can print php but I have to format html to print properly.

Code:
<img src="images/barn_2_draft.gif" alt="#" title="The Gable" width="115" height="86"
onmouseover="Tip('<?php print("Can gophers really code PHP?");?>', HEIGHT, 125, WIDTH, 380, TITLE, 'The Gable', TITLEFONTSIZE, '13pt', FADEIN, 200, FADEOUT, 300, CLOSEBTN, true,  STICKY, true)" 
onmouseout="UnTip()" />
Would that link you posted allow me to do this?

<--- I would like to put ANY html in here--->

Code:
<img src="images/barn_2_draft.gif" alt="#" title="The Gable" width="115" height="86"
onmouseover="Tip('<?php print("<--- I would like to put ANY html in here--->");?>', HEIGHT, 125, WIDTH, 380, TITLE, 'The Gable', TITLEFONTSIZE, '13pt', FADEIN, 200, FADEOUT, 300, CLOSEBTN, true,  STICKY, true)" 
onmouseout="UnTip()" />
__________________
Man... IE stinks ... and If I get one more contingency offer!!! **Sydpixel**

Last edited by Sydpix : 04-27-2008 at 08:18 AM.
Sydpix is offline
Reply With Quote
View Public Profile Visit Sydpix's homepage!
 
Sponsored Links (We share ad revenue):
 
Reply     « Reply to How to display html in javascript without canceling out specific tags?
 

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML


Page generated in 0.13732 seconds with 14 queries