Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
How to display html in javascript without canceling out specific tags?
Old 04-26-2008, 06:58 PM How to display html in javascript without canceling out specific tags?
Sydpix's Avatar
Drinker I Smoke

Posts: 424
Name: Denny
Location: In a can...
Trades: 0
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?
__________________
.
Village Idiot

Sydpix is offline
Reply With Quote
View Public Profile Visit Sydpix's homepage!
 
 
Register now for full access!
Old 04-27-2008, 04:05 AM Re: How to display html in javascript without canceling out specific tags?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-27-2008, 09:03 AM Re: How to display html in javascript without canceling out specific tags?
Sydpix's Avatar
Drinker I Smoke

Posts: 424
Name: Denny
Location: In a can...
Trades: 0
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()" />
__________________
.
Village Idiot


Last edited by Sydpix; 04-27-2008 at 09:18 AM..
Sydpix is offline
Reply With Quote
View Public Profile Visit Sydpix's homepage!
 
Reply     « Reply to How to display html in javascript without canceling out specific tags?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 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.11453 seconds with 12 queries