Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Html-iFrame-Javascript

Html-iFrame-Javascript

Scheduled Pinned Locked Moved Web Development
javascriptphphtmlsysadmintools
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LordLothar
    wrote on last edited by
    #1

    I have html which contain iframe in it. I have a button in my html which will call javascript(ajax) function and I will get server response from php script. Normally if I want to display it in my main html, I can use:

    var spantag=document.getElementById("displayCamera");
    spantag.innerHTML=xhr.responseText;

    How can I display the result into other html file/my iframe(let say I have span id in html of the iframe).

    Y 1 Reply Last reply
    0
    • L LordLothar

      I have html which contain iframe in it. I have a button in my html which will call javascript(ajax) function and I will get server response from php script. Normally if I want to display it in my main html, I can use:

      var spantag=document.getElementById("displayCamera");
      spantag.innerHTML=xhr.responseText;

      How can I display the result into other html file/my iframe(let say I have span id in html of the iframe).

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      try window.iframeID.spanID where iframeID is the id of your iframe and spanID is the id of your span.

      Yusuf Can I help you?

      L 1 Reply Last reply
      0
      • Y Yusuf

        try window.iframeID.spanID where iframeID is the id of your iframe and spanID is the id of your span.

        Yusuf Can I help you?

        L Offline
        L Offline
        LordLothar
        wrote on last edited by
        #3

        Its done by window.frames["displayCatalog"].document.getElementById("displayCamera").innerHTML = xhr.responseText; So I have to change the iframe's attribute to name and not id. Thanks though for the heads up.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups