File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Ajax functionality - XMLHttpRequest Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Ajax functionality - XMLHttpRequest" Watch "Ajax functionality - XMLHttpRequest" New topic
Author

Ajax functionality - XMLHttpRequest

Hardik Raja
Ranch Hand

Joined: Feb 07, 2006
Posts: 117
Hello JavaRanchers,

The function below is a javascript function that has AJAX code to request and recieve data from a servlet.




Questions:

1.The above code works in firefox version 2.0.0.1.4 but not in Internet Explorer 7(Just displays a blank page). Any input on this ?

2.As I said earlier, this code works in firefox version 2.0.0.1.4 but it gives me the below error when it works on firefox version 3.0.1. I traced this error through firebug( an addon in firefox ) and it shows the below error on line 20,

uncaught exception: [Exception... "Not enough arguments [nsIXMLHttpRequest.send]" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :: http://localhost:8080/Iward/login :: xmlhttpPost :: line 20" data: no]


Line 0

Based on this error, I checked my javascript function code, but i am not able to understand whats wrong with it.

Could anyone please provide thier input on it ?

Thanks,
Hardik Raja
SCJP 5.0
[ August 18, 2008: Message edited by: Hardik Raja ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Try send(null) or send ('').


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Or better yet, follow the advice of the more experienced Ajax developers and adopt a library to handle all the intricacies and cross-browser nuances of Ajax for you. I highly recommend one of Prototype or jQuery. jQuery has the most painless Ajax integration, in my opinion.
Hardik Raja
Ranch Hand

Joined: Feb 07, 2006
Posts: 117
Dear Bear Bibeault,

Using send(null) doesn't display the error, I had mentioned earlier and thanks for you input on using jquery. Thank You.

Regards,
Hardik
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Ajax functionality - XMLHttpRequest
 
Similar Threads
JavaScript not working in IE7 but working in firefox
Ajax Hello World example using Servlet
How to pass url to Struts1.3
How to disply in the page
problem with sending # character through ajax