Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript clone contents of a div into iframe problem

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #236473
    wolfgang1983
    Participant

    I have a small problem with my code view iframe.

    When I type content into my editable div and then click on my code view button it should display exactly the same.

    And then when I click that code view button again it goes back to editable div.

    But for some reason when I go back to the editable div after clicking on the code view button it clones the same code again into iframe.

    How could I stop that so will not clone code multiple times.

    http://codepen.io/riwakawebsitedesigns/pen/bEqWBr

    #236483
    mrben
    Participant

    I think you should use .html instead of .append…

    http://codepen.io/mrben/pen/OMmLRb

    #236500
    wolfgang1983
    Participant

    Thanks for that solved my problem

    #236522
    mrben
    Participant

    Cool! Glad it helped!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.