Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 08-20-2007, 11:49 AM
  #1
interpolarity
Champion (Level 13)
 
interpolarity's Avatar
 
Join Date: Feb 2007
Posts: 250
iTrader: (0)
interpolarity is an unknown quantity at this point
Click to replace text in div (was to produce iframe)

Can I have a link that when clicked, produces an iframe where the text used to be? Also, I would like to have other links on the page that would do the same thing, except they would also take away the iframe produced before.

Brownie points for anyone that can make it have a collapse type effect

as a side note, I CANNOT write JavaScript at ALL...I tried, and this is what I produced...
<a name="test" id="test" onclick="document.write("<iframe height="400px" width="400px" src="test.html"></iframe>")">Test</a>

but it didn't work...(no surprise there....)

please help... it is a bit urgent...
__________________
My Website
All above the influence of smoking, drinking and drugs, post this in your signature. Live above the influence.
If what I did helped, don't forget to add reputation (the scales at the bottom left of the post)

Last edited by interpolarity : 08-20-2007 at 01:37 PM.
interpolarity is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-20-2007, 12:21 PM
  #2
Gamini
Dissapearing act
 
Gamini's Avatar
 
Join Date: May 2004
Location: In my house
Posts: 1,866
iTrader: (0)
Gamini is on a distinguished road
HTML Code:
<html>
<head>
<script type="text/javascript">
    function create() {
            iframe = document.createElement('iframe'); 
            iframe.setAttribute('height', '400px'); 
	    iframe.setAttribute('width', '400px'); 
	    iframe.setAttribute('src', 'licheck.html'); 
            iframe.setAttribute('id', 'frame'); 
            
            div = document.getElementById('container'); 
            div.appendChild(iframe); 
    }

    function destroy() {
           document.getElementById('frame').style.display = 'none'; 
    }
</script>
<body>
<div id="container"></div>
<a href="#" onClick="create()">Create</a>
<a href="#" onClick="destroy()">Destroy</a>
</body>
</html>

Comments on this post
interpolarity agrees:
__________________
Blink
Gamini is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-20-2007, 12:36 PM
  #3
interpolarity
Champion (Level 13)
 
interpolarity's Avatar
 
Join Date: Feb 2007
Posts: 250
iTrader: (0)
interpolarity is an unknown quantity at this point
AMAZING!!

I hope I'm not asking too much, but is it possible to have the link destroy any previous iframes made, and then produce...or just replace it? like switch an attribute?
If so, GREAT!
If not, the one you gave is fine
__________________
My Website
All above the influence of smoking, drinking and drugs, post this in your signature. Live above the influence.
If what I did helped, don't forget to add reputation (the scales at the bottom left of the post)
interpolarity is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-20-2007, 12:55 PM
  #4
interpolarity
Champion (Level 13)
 
interpolarity's Avatar
 
Join Date: Feb 2007
Posts: 250
iTrader: (0)
interpolarity is an unknown quantity at this point
actually, I would REALLY appreciate code that would allow me to change the iframe's src attribute..... pretty please

*edit* sorry for the confusion, and thank you for your help, but I realized that divs would look better than iframes.... what I want is several links that when you click them, the content inside the div changes... once again, sorry for the confusion
__________________
My Website
All above the influence of smoking, drinking and drugs, post this in your signature. Live above the influence.
If what I did helped, don't forget to add reputation (the scales at the bottom left of the post)

Last edited by interpolarity : 08-20-2007 at 01:05 PM.
interpolarity is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-20-2007, 04:22 PM
  #5
interpolarity
Champion (Level 13)
 
interpolarity's Avatar
 
Join Date: Feb 2007
Posts: 250
iTrader: (0)
interpolarity is an unknown quantity at this point
I found what I was looking for...
http://www.netlobo.com/div_hiding.html
__________________
My Website
All above the influence of smoking, drinking and drugs, post this in your signature. Live above the influence.
If what I did helped, don't forget to add reputation (the scales at the bottom left of the post)
interpolarity is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 01:16 PM
  #6
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 8,845
iTrader: (0)
coothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud of
Hi there interpolarity,

this may be a little late but you may find that it could suit your requirements also...
show, replace and hide iframes

Comments on this post
interpolarity agrees:
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 03:24 PM
  #7
interpolarity
Champion (Level 13)
 
interpolarity's Avatar
 
Join Date: Feb 2007
Posts: 250
iTrader: (0)
interpolarity is an unknown quantity at this point
I really like that, and will consider it for other things in my site..
thanks
__________________
My Website
All above the influence of smoking, drinking and drugs, post this in your signature. Live above the influence.
If what I did helped, don't forget to add reputation (the scales at the bottom left of the post)
interpolarity is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-21-2007, 03:34 PM
  #8
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 8,845
iTrader: (0)
coothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud of
Hi there interpolarity,

No problem, you're welcome.
I forgot to say that the script does not have to have an iframe but can be used for various purposes.
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-22-2007, 08:05 AM
  #9
interpolarity
Champion (Level 13)
 
interpolarity's Avatar
 
Join Date: Feb 2007
Posts: 250
iTrader: (0)
interpolarity is an unknown quantity at this point
oooh, really? how can it be adapted for divs?
__________________
My Website
All above the influence of smoking, drinking and drugs, post this in your signature. Live above the influence.
If what I did helped, don't forget to add reputation (the scales at the bottom left of the post)
interpolarity is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-22-2007, 11:20 AM
  #10
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 8,845
iTrader: (0)
coothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud of
Hi there interpolarity,
Quote:
...how can it be adapted for divs?
Well, like this...
show, replace and hide content
I presume that you could also use includes if you wanted to.
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-22-2007, 07:56 PM
  #11
interpolarity
Champion (Level 13)
 
interpolarity's Avatar
 
Join Date: Feb 2007
Posts: 250
iTrader: (0)
interpolarity is an unknown quantity at this point
I LOVE YOU!!!
you are a coding God!!!
__________________
My Website
All above the influence of smoking, drinking and drugs, post this in your signature. Live above the influence.
If what I did helped, don't forget to add reputation (the scales at the bottom left of the post)
interpolarity is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 08-22-2007, 11:24 PM
  #12
coothead
~ bald headed old fart ~
 
coothead's Avatar
 
Join Date: Aug 2003
Location: chertsey, a small town 25 miles south west of london, england.
Posts: 8,845
iTrader: (0)
coothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud ofcoothead has much to be proud of
Hi there interpolarity,
Quote:
I LOVE YOU!!!
you are a coding God!!!
Steady on there.
It is said that distance lends enchantment.
But the reality is that I am just a bald headed old fart.
I am pleased, though, that I have been able to bring a little happiness into your life.
__________________
coothead is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 05:29 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.