SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting innerstring of iframe section

    Hello i have a function like this
    function mycallback(IDVal)
    {
    MyDIVsection.innerHTML = '<IFRAME src="GetInfo.aspx?ID=' + IDVal + '" width="200" height="50" frameborder="0"></IFRAME>';
    }

    This javascript function will request the GetInfo.aspx page and pass the ID value and i put some info on that page based on that ID and when i assign that to my MYDIVSection <DIV> tag's innerHTML i get all the information that were in GetInfo.aspx. But my problem is with iFRAME where managing the height and width of Iframe based on the size of the info i recieve from the server is too much of coding.So what i like to know is , say i have iframe and i have the information as string from IFRAME section and is it possible to only pull the information from the IFRAME section so that i get only the info and not the Iframe so that i can put the Info into my MYDIVSection DIV tag.

    Thanks and Regards
    Knowledge is all about Sharing

  2. #2
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    germany
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello
    I have made to work in such way.Please let me know if there is any better way than this to do.
    1. I made the IFRAME width and height =0 and no scroll and no border.
    2. That source page of the Iframe body does not contains any content so it is plain empty page.
    3. I made a javascript and call the parent div id by parent.form.getdocumentbyid("mydivid")="MyINFO"
    and when the page loads and this javsacript section executes and the info i have is send to parent page. and it worked.

    Please let me know if there is any other way to do this.
    Ofcourse AJAX and ATLAS are there but i want to use this method which is very simple and effective and very little javascript code and , getinfo.aspx will do the same function as that of webservice will do.
    Looking forward to your comments.

    Thanks and Regards
    Knowledge is all about Sharing

  3. #3
    Barefoot on the Moon! silver trophy
    Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,516
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    [edit]: nevermind


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
  •