Add to Google

Javascript loading iframes

free web hosting
Open Discussion > Have your say > General Talk

Javascript loading iframes

StonedDevil
Im getting this message

CODE
Line: 14

Char: 3

Error: 'document.getElementByID(...)' is null or not an object

Code: 0

URL: http://www.stoneddevilinc.com?i=full_site_part_1.html


when i try to run this code

CODE
<script type='text/javascript'>



function setIframe() {



var url = window.location.href;

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

if( i>-1 ) {

 url = url.substr(i+3);

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

}



}



window.onload = setIframe();



</script>


with this url

CODE
http://www.stoneddevilinc.com/?i=full_site_part_1.html


to pull up this iframe

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


with this source

CODE
full_site_part_1.html


Im putting my tutorials up on a site and i need to have a link that loads the iframe with the right content. PLEASE HELP!!

 

 

 


Comment/Reply (w/o sign-up)

StonedDevil
ok fixed the javascript but still no go

CODE
<script language="JavaScript" type='text/javascript'>



function setIframe() {



var url = window.location.href;

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

if( i>-1 ) {

 url = url.substr(i+3);

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

}



}



window.onload = "setIframe()";



</script>

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : javascript, loading, iframes

  1. Reason For Trap17's Slow Loading?
    Anyone else have this? (17)
  2. Iframe External Link (Javascript)
    (0)
    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 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 of course replace th....
  3. Loading values in txt file to database
    (0)
    I have a script that during the install, I am to run a file that is supposed to load zip code data
    into the database. It says it runs correctly at the end but yet the table in the database remains
    empty. Here is the code: PHP Code: CODE require('data.php');
    require('functions.php'); sql_connect(); $file=file("admin/zip.txt"); $i=form_get("i");
    $start=$i+1; $end=$start+5000; if($end>=count($file)){ $end=count($file); }
    for($i=$start;$i $sql_query=$file ; sql_execute($sql_query,''); if($i%5000==0){
    $link=$main_url."/....
  4. Javascripts and Iframes withing php nuke ????
    (1)
    when ever i try and put in some java into blocks or storys it says my html tags are not accepted ...
    is there anyway i can change this too be accepted also can i install iframes or anothe photo gallery
    thing.....
  5. Javascript/HTML form submissions On a Mac
    (1)
    My hope is that someone out there can help me with this problem. I have some javascript that will go
    thru (on a PC that is) a HTML page looking for a specifc word submitted via an onclick function.
    Orginally it was a form submission with an onsubmit that ran the function. But in trying to
    trouble shoot it I thought the mac was submitting the form differently than the PC versions (maybe
    the DOM) so I created a button with an onclick command. Again it works for the PC but not for the
    MAC. I am at my wits end. If someone can help; below is the code I am using. I....
  6. iframes
    (2)
    My site, http://www.stoneddevilinc.com uses iframes for its content. I want to put up my tutorials
    on good-tutorials.com and i have do directly link to that tutorial. But since i use iframes, i cant
    link to it normally. Is ther any way to do this? something in javascript to load the page then
    load the iframe? PLEASE HELP!!!....
  7. JavaScript PHP redirecting
    (2)
    Hi there! /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> Is
    there a way to use JS to change a form's submit target based on which submit button was pressed?
    Eg. CODE Register Login Thank you!! Added code tags--CodeFX ....
  8. javascript
    (3)
    some nice javascript to add in your site CODE cell bg changer .tditem { font-size:
    12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none; color: gray; }
    Item 1 | Item 2 | Item 3
    ....
  9. A GREAT JAVASCRIPT COLLECTION
    (1)
    Best program containing many Java scripts AA Scripter. Can be downloaded from this link
    http://www.cyberiapc.com/aa/aascripter.htm **Changed all caps to correct case. --CodeFX ....
  10. Excellent site for Javascript Tools
    (1)
    This is the best source for Javascript tools. http://www.codebrain.com/ **Removed all caps
    --CodeFX ....
  11. Browser Redirection Javascript code.
    (1)
    Hi does anyone have a browser direction code( so if someone went to my site with IE it would forward
    to a site telling you to download Firefox). If so could you email it to me : daniel dot maxson at
    gmail dot com Thanks Daniel....
  12. Kickoff Frame Javascript
    (1)
    Hi I have this javascript ------------------------------ CODE if
    (parent.frames.length==0) parent.location.href="Redirect to?" -->
    ------------------------------ Is this the right one for kicking off frames? Dani **Code
    tags added**--CodeFX ....
  13. My site is not loading... www.jnehemiah.com
    (4)
    Admin My site is not loading.. Please consider mine... My site is www.jnehemiah.com....
  14. [JavaScript] Check for Flash
    (0)
    This script i have modified. With this script you can check if Flash is installed. CODE  
      var flashinstalled = 0;   var flashversion = 0;   MSDetect = "false";   if
    (navigator.plugins && navigator.plugins.length)   {      x = navigator.plugins ;      if (x)
         {         flashinstalled = 2;         if (x.description)         {            y =
    x.description;            flashversion = y.charAt(y.indexOf('.')-1);         }      }    
     else         flashinstalled = 1;      if (navigator.plugins )      {         flashinsta....
  15. A script for Loading
    (4)
    Paste this script below between and CODE var ua = window.navigator.userAgent; var
    ie = /msie /i.test(ua); var ie5 = /msie 5.0/i.test(ua); var timer; function progressorbar()
    {}; progressorbar.dir = 1; progressorbar.width = 300; progressorbar.height = 90;
    progressorbar.timer; progressorbar.fixpostion = function(){    var w = document.body.clientWidth
    || window.innerWidth;    var h = document.body.clientHeight || window.innerHeight;    var x =
    document.body.scrollLeft;    var y = document.body.scrollTop;    var l = x + parseInt((w ....
  16. Border removal on Iframes
    (3)
    Does anyone know of a script that can either remove the border or change the color of an IFrame. I
    want to get rid of the border in my frame so it blends in well. here's what I'm talking about:
    http://resnet.freenukehosting.com Your help will be much appreciated.....
  17. Javascript? I Need a random picture thingy>>>
    (6)
    I need a script or something so that every time a page is loaded, there is a different picture
    shown...? and so I can like put a list of URL's and it goes through them randomly or just has an
    order.......
  18. internet security problems, can't open javascript!
    (1)
    Help me out please. I was trying to use a new anti virus program, Kaspersky. After I used it for one
    full scan my computer has gone totally mad! On the internet I cant open half the links, anything
    with javascript. on the bottom of my browser it just starts complaining... Even worse is the fact
    that I can't open my Windows Mediapplayer since the scan. It just says: 'internal application
    error'. I tried everything; uninstall, reinstall, I can use the mplayer2, but I'm used to the luxury
    of WMP10. Please help me out guys. My room is too quiet without my music........
  19. Why is the loading speed so slow ?
    (4)
    I've just installed a IBF v2.0.2 but images loading very very slowly,My forum runs so
    slowly.Why?Slow hosting speed?? http://anh84ls.freenukehosting.com/diendanls ....
  20. JavaScript--A snow storm
    (13)
    A snow storm: after or QUOTE N = 40;   Y = new Array(); X = new Array(); S =
    new Array(); A = new Array(); B = new Array(); M = new Array(); V = (document.layers)?1:0;
    iH=(document.layers)?window.innerHeight:window.document.body.clientHeight;
    iW=(document.layers)?window.innerWidth:window.document.body.clientWidth; for (i=0; i Y
    =Math.round(Math.random()*iH); X =Math.round(Math.random()*iW); S
    =Math.round(Math.random()*5+2); A =0; B =Math.random()*0.1+0.1; M
    =Math.round(Math.random()*1+1); } if (V){ for (i = 0; i {document.wr....
  21. Javascript sites
    (9)
    Here are some sites for your javascript needs: http://www.dynamicdrive.com/
    http://www.javascript-2.com/ http://javascript.internet.com/
    http://javascriptkit.com/script/cut57.shtml http://www.webreference.com/js/
    http://www.codehouse.com/ http://www.freewarejava.com/ http://a1javascripts.com/
    http://hotscript.com/ To Learn javascript: http://www.javascriptmall.com/learn/contents.htm
    http://www.w3schools.com/js/default.asp Good luck!....

    1. Looking for javascript, loading, iframes

Searching Video's for javascript, loading, iframes




advertisement



Javascript loading iframes