www.webdeveloper.com
Results 1 to 3 of 3

Thread: Changing frame sources

  1. #1
    Join Date
    Mar 2012
    Posts
    3

    Changing frame sources

    I will be direct.

    How do I change the source of a frame? I don't want to change the source URL, I want to change the source itself.

    Let's say I have a frame, and the source of the frame is:
    Code:
    <p>Hey earth!</p>
    Then there's a textbox where the user types a planet name, for example. If him typed "mars" the new source would be:

    Code:
    <p>Hey mars!</p>
    Tried google, but it only teaches how to change the source URL.

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,671
    what you call 'source of a frame'? are you talking about changing text between <p></p> tags? or it is changing elements on a page in an iframe?

  3. #3
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    If you want to change the content in the iframe, the data into a tag, you can use this syntax:
    Code:
    myIFrame.contentWindow.document.getElementById('id_elm_in_iframe').innerHTM = 'New data';

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles