1) Script Title: Random iframe content
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndomiframe.htm
3) Describe problem: I want to display the URL of the page displayed
1) Script Title: Random iframe content
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndomiframe.htm
3) Describe problem: I want to display the URL of the page displayed
Here in the script:
Is where it sets the src attribute of the iframe. If you had - say a link or other element that you wanted to have display the url, you could do this:Code:iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
You would need to define el earlier in the script though - before the code executes and after the browser parses the element. So,you could put a span on the page before the script:Code:el.innerHTML=iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
Then at the beginning of the script define it:HTML Code:<span id="urlholder"></span>
Code:var el=document.getElementById('urlholder');
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
John, thanks for the details on how to solve this problem. For the time being I am going to stick to the URL button that opens the viewed page, and see what kind of a response I get. Your new code for backing up within the frame could change that decision. Here is the current layout: http://www.kabubble.com/pingxit_news.htm.
Bookmarks