473,409 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

XMLHttpRequest and new frame?

Hello,

I am trying to get XMLHttpRequest etc to send a javascript variable to
a php file which will search a MySQL database but I want the results
to appear in a different frame.

How can I do this?!

Using a different approach I can get this to work.

window.parent.frameright.location.href = etc

where the different frame is called frameright.

I need an equivalent method with

function startRequest(url) {
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

In other words how do I get frameright as the target for the above
url?

Ideas please?

Cheers

Geoff
Mar 9 '07 #1
4 2444
On Mar 9, 12:31 pm, Geoff Cox wrote:
Hello,

I am trying to get XMLHttpRequest etc to send a javascript variable to
a php file which will search a MySQL database but I want the results
to appear in a different frame.

How can I do this?!

Using a different approach I can get this to work.

window.parent.frameright.location.href = etc

where the different frame is called frameright.

I need an equivalent method with

function startRequest(url) {
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

In other words how do I get frameright as the target for the above
url?

Ideas please?

Cheers

Geoff
Why not just have your handleStateChange function (in the same frame)
receive the value and then send the value to your other frame? AFAIK
there is no "target" value on xmlhttprequests.

Mar 9 '07 #2
On 9 Mar 2007 09:54:50 -0800, "Tom Cole" <tc****@gmail.comwrote:

>Why not just have your handleStateChange function (in the same frame)
receive the value and then send the value to your other frame? AFAIK
there is no "target" value on xmlhttprequests.
OK - how do you send the value to the other frame?

Cheers

Geoff
Mar 9 '07 #3
On Mar 9, 1:07 pm, Geoff Cox wrote:
On 9 Mar 2007 09:54:50 -0800, "Tom Cole" <tco...@gmail.comwrote:
Why not just have your handleStateChange function (in the same frame)
receive the value and then send the value to your other frame? AFAIK
there is no "target" value on xmlhttprequests.

OK - how do you send the value to the other frame?

Cheers

Geoff
You access other frames through their names.

If the frame you want to pass the value to is in the same frameset,
then you can call parent.<other_frames_name>.method(value) to pass
that value to the "method" in the "other_frame_name".

If it is in another frameset, you can use top to get to the top of the
frame tree.

HTH.

Mar 9 '07 #4
ASM
Geoff Cox a écrit :
Hello,

I am trying to get XMLHttpRequest etc to send a javascript variable to
a php file which will search a MySQL database but I want the results
to appear in a different frame.
why would you have to use XHR to send result from a form to a frame ?

Basic JS does it very well

<form action="searchSQL.php" target="myFrame" method=post>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Mar 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris Smith | last post by:
This is a bit of a weird problem. Unfortunately, I can't reproduce it in a simple example, so I can only poke it out there and see if anyone has seen something similar. I have a script that...
4
by: David Wang | last post by:
Ive been playing around with xmlHTTPRequest and was wondering if i was programming a part of my code wrong. what i want to do is have the browser access another part of my site using...
42
by: Greg | last post by:
Hi, I've designed a bookmark in Ajax / PHP that I will put soon on sourceforge.net. But I've got an very tricky bug. I try it on some computers with Internet Explorer/Windows, Firefox...
13
by: iannorton | last post by:
Hi there, I Recently started experimenting with AJAX and succesfully created an autocomplete box using a script that returned html from a serverside javascript page. I'm now at the point...
18
by: William | last post by:
I have the following javascript function that updates a scroll_list and sends the updated entry (with its index) to a server script ( i.e. http://mkmxg00/cgi/confirmUpload.pl ) for further...
10
by: test | last post by:
Hi, I want to asynchronously recieve large amount of data using XMLHTTPRequest. If it is possible, I would like to make a progress bar to show the user how the process is going. According to...
9
by: Phil_Harvey | last post by:
I am redoing my website and trying to get it to do something more exciting using Javascript. I did normal Java at university and code at work in VB.NET. I have got reasonably far into what I want...
2
by: Gianluca | last post by:
Hi all, I developed a portal using Joomla 1.0.13 and Joomlajax (a plugin to implement Ajax in Joomla, based on Scriptaculous and Prototype) as core. I added some javascript code on index.php to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.