Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-23-2012, 02:41 PM   PM User | #1
WolfShade
Regular Coder

 
Join Date: Apr 2012
Location: St. Louis, MO, USA
Posts: 946
Thanks: 7
Thanked 97 Times in 97 Posts
WolfShade is an unknown quantity at this point
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".
WolfShade is offline   Reply With Quote
Old 05-23-2012, 08:55 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
First of all: Why do you want (need?) to use iframes?
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:04 AM.


Advertisement
Log in to turn off these ads.