www.webdeveloper.com
+ Reply to Thread
Results 1 to 3 of 3
  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
    Russia, Rostov-on-Don
    Posts
    1,150
    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?
    use [code]YOUR CODE GOES HERE[/code] or burn in Hell

  3. #3
    Join Date
    Feb 2011
    Posts
    225
    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';
    Free resources, Courses and Tutorials for Web Programmers

Thread Information

Users Browsing this Thread

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

     

Bookmarks

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