Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: AJaX and iFrame

  1. #1
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts

    AJaX and iFrame

    Hello, everyone.

    I'm working with AJaX as a beginner and could use some advice.

    I've got a page with a "header" DIV, and two IFRAME columns under it. The DIV contains a form that I am attempting to submit via AJaX, but I would like the results to appear in the left IFRAME column. How do I get the AJaX to make the results appear in the IFRAME?

    Unfortunately, where I work is a very secure environment and I cannot copy/paste code, here. I'll try to give an idea of what I have:

    Code:
    function ajaxGet() {
      function ajaxReq() {
        if window.ActiveXObject - return new ActiveXObject
        else if window.XMLHttpRequest - return new XMLHttpRequest
        else return false
      }
      myajaxrequest = new ajaxReq();
      myajaxrequest.onreadystatechange = function() {
        if all is well
          -- HERE is where I don't know how to get results to iframe
        }
      myvar = document.getElementById("thisField").value;
      myvar = encodeURIComponent(myvar);
      myajaxrequest.open("GET","file.cfm?value=" + myvar, true);
      myajaxrequest.send(null);
    }
    Thoughts?

    Thank you,
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,355
    Thanks
    11
    Thanked 558 Times in 551 Posts
    First of all: Why do you want (need?) to use iframes?


  •  

    Posting Permissions

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