473,495 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ajax function call

Hi all,

How to call a function that has a string variable as the parameter
during http.onreadystatechange event is met? I tried this

http.onreadystatechange = MyFunction (stringVar);

but it gave me an error message: "Type mismatch". Please help me.
Thanks.

Aug 15 '06 #1
2 1562
Henry wrote:
How to call a function that has a string variable as the parameter
during http.onreadystatechange event is met? I tried this

http.onreadystatechange = MyFunction (stringVar);

but it gave me an error message: "Type mismatch". Please help me.
Try:

http.onreadystatechange = function (stringVar) { ... };

Or:

http.onreadystatechange = function () { MyFunction (stringVar); };
JW
Aug 15 '06 #2
Hi JW,

I tried the second option and it works. Thanks a lot for your help.

Regards,
Henry

Janwillem Borleffs wrote:
Henry wrote:
How to call a function that has a string variable as the parameter
during http.onreadystatechange event is met? I tried this

http.onreadystatechange = MyFunction (stringVar);

but it gave me an error message: "Type mismatch". Please help me.

Try:

http.onreadystatechange = function (stringVar) { ... };

Or:

http.onreadystatechange = function () { MyFunction (stringVar); };
JW
Aug 16 '06 #3

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

Similar topics

4
4036
by: Frances | last post by:
I literally started learning AJAX just last weekend.. I have this page, http://www.francesdelrio.com/ajax/db2.html, where I'm essentially doing what's here,...
4
1340
by: pbd22 | last post by:
Hi. I have an ajax question. I am wondering if it is possible to get the response from a method within a given page, and that function alone? Traditionally, I have been getting the response...
17
11835
by: Arjen | last post by:
Hi, I want to reload 2 divs at one click. Ive tried: <a href = "javascript:void(0);"...
6
5120
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
2
4532
by: germ | last post by:
doing a simple page webmethod call an a page via PageMethods works fine in ie7 & opera9 the same call on firefox ( and I assume netscape ) generates the following error : Error: " nsresult:...
3
2718
by: nghivo | last post by:
I attempted to synchronize async Ajax calls using the following JS blocks: ==================================================== function getXMLHTTPRequest() { try { req =...
3
3928
by: dhsieh | last post by:
I am trying out nested AJAX calls for the first time, but I seem to have hit a snag. The code snippet is the outer AJAX call and a function, it gathers information about a company. As we get towards...
3
2055
by: wendallsan | last post by:
Hi All, I've stumped myself writing an app that uses Prototype and a bit of PHP. Here is what I have: I have a custom class named Default_county_init_data that, upon initialization makes...
6
7931
by: sheldonlg | last post by:
I came across a problem and googling for an answer didn't help. What I want to do is run an AJAX script that sets a hidden variable on the form. I call the AJAX script from a javascript...
0
7120
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
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7373
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
5456
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,...
1
4897
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...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.