|
How to display html in javascript without canceling out specific tags?
04-26-2008, 06:58 PM
|
How to display html in javascript without canceling out specific tags?
|
Posts: 424
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('<div id=\'box_1\'><img src=images/Barns/barn_2.gif width=145 height=110 ><\/div><div id=\'box_2\'><strong>The Gable features <\/strong>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 \/><\/div><div id=\'box_3\'><img src=images/Barns/barn_1.gif width=145 height=110 ><\/div><div id=\'box_4\'>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.<\/div>', 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
|
|
|
|
04-27-2008, 04:05 AM
|
Re: How to display html in javascript without canceling out specific tags?
|
Posts: 41,520
Name: Chris Hirst
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|
|
|
|
04-27-2008, 09:03 AM
|
Re: How to display html in javascript without canceling out specific tags?
|
Posts: 424
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()" />
__________________
.
Village Idiot
Last edited by Sydpix; 04-27-2008 at 09:18 AM..
|
|
|
|
|
« Reply to How to display html in javascript without canceling out specific tags?
|
|
|
| Thread Tools |
Search 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
HTML code is Off
|
|
|
|