How can I get an ID outside of a IFRAME

Getting an ID outside of a IFRAME inside a document.

Page 1 of 1

2 Replies - 2001 Views - Last Post: 23 July 2009 - 06:00 PM

#1 EvolutionMedia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

How can I get an ID outside of a IFRAME

Post icon  Posted 23 July 2009 - 12:57 PM

This may be hard to explain but I was wondering - well wait. Okay, I have a index.html file that has an IFRAME. What I'm trying to do is display a video playlist in the iframe and when the user clicks on what video he wants to watch it will put it in code necessary outside of the IFRAME.

I have to div id's in the index.html

DIV #1 is ID = VideoCode;
DIV #2 is ID = VIdeoDesc;

inside Playlist.html file I have this script:

function SelectVideo(num) {
var VideoCode =  window.top.document.getElementById('VideoCode');
var VideoDesc = window.top.document.getElementById('VideoDesc');

switch(num) {
case "00":
VideoCode.innerHTML = '<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/U6J0ftKx3dw&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/U6J0ftKx3dw&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>';
VideoDesc = "Bachelors Grove is the most haunted place in Illinois. The oldest graves date back 1800's. Before the team was formed - Eclipses Productions; runned by David W. and his brother Max found an interesting sighting.";
break;




I have an error that says, "VideoCode is null on line 70".

ANyways to fix this? Thanks! I tried looking up some stuff online about this and I thought I was close but I guess not. I know that it's returning null because maybe it can't find it or has nothing or no value to it.

So, how do I fix this immediately. I have visitors on my page and don't want to delay them.

-Paul

Is This A Good Question/Topic? 0
  • +

Replies To: How can I get an ID outside of a IFRAME

#2 aosmith  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-July 09

Re: How can I get an ID outside of a IFRAME

Posted 23 July 2009 - 05:31 PM

iirc javascript wont allow you to escape the iframe... I know ajax runs in a "sandbox" for security reasons.
Was This Post Helpful? 0
  • +
  • -

#3 EvolutionMedia  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 125
  • Joined: 11-August 08

Re: How can I get an ID outside of a IFRAME

Posted 23 July 2009 - 06:00 PM

I solved it using framesets. Thanks though!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1