Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Iframe External Link (Javascript)
StonedDevil
post Mar 7 2005, 09:40 PM
Post #1





Guests






This code will allow people who use iframes to link to there page, then load the iframe so that they can give external links to people that will link directly to the iframe page they want to see.

now this first part has to be in the head of your document
CODE


<script type='text/javascript'>



window.onload = function setIframe() {



var url = window.location.href;

var i = url.indexOf("?i=");

if( i>-1 ) {

 url = url.substr(i+3);

 document.getElementById("body").src = url;

}



}



now this is about how your iframe tag should look
CODE


<iframe src="home.html" WIDTH=505 HEIGHT=420 name="content" id="body"></iframe>


of course replace the src/height/width/name with whatever you have in yours, the important part is "id=body"

here is the way you should make your links
CODE


http://www.yourdomain.com?i=pagetoload.html



to see this code in action, click this link

http://www.stoneddevilinc.com?i=template_r...equest_form.php
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. ZELDA and LINK(31)
  2. Javascript Slideshow Tutorial(4)
  3. Linking A Url To A Button(4)
  4. Image Preloader With Progress Bar Status(23)
  5. Javascript Close Window(15)
  6. Adding Rows & Columns In Html Table Using Javascript(1)
  7. Trap17 Link Exchange Script Introduced(28)
  8. Playing Flash Movies Without The One-click Activation: Simple Insertion Of Javascript(4)
  9. Web Page Tree Menu: Style Sheet - Javascript(6)
  10. Learn Html Quick And Easy(14)
  11. Can I Make Dynamic Menu In Php(7)
  12. Problem With My External Hard Disk(7)
  13. Simple Javascript And Password System(9)
  14. Do You Close The Javascript?(4)
  15. Dreamweaver Cs3: How To Link Content To Layers/apdivs(5)
  1. Lesser Known Useful Javascript Features(2)
  2. Need Help With My Database [resolved](6)
  3. Making A Picture Viewer Website(3)
  4. Soa Architecture(0)
  5. Javascript And Ajax For The Web, Sixth Edition Review(0)
  6. Creating A Floating Javascript Docking Menu(1)
  7. Browser Compatibility Problem With Firefox - Javascript + Css(3)
  8. Seeking Help With Javascript(1)
  9. An Error Thought I'd Let The Admins Know About.(4)
  10. Video Play Like Youtube(3)
  11. Validating Javascript(2)
  12. Need Help With Javascript Drag And Drop Script(2)
  13. [req & Suggest] -[news Link]-(2)


 



- Lo-Fi Version Time is now: 7th October 2008 - 09:49 PM