wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Passing parameter in ajax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Passing parameter in ajax" Watch "Passing parameter in ajax" New topic
Author

Passing parameter in ajax

Adrian Perry
Ranch Hand

Joined: Jul 21, 2005
Posts: 42
Hi,

In our project we are using Ajax. We have set up a div using Ajax and load this div with various html files. The rest of the page remains same, only the div element which load html pages keeps changing, relative to the html pages being called. Now in this html file I have many textfields, whose value I want to pass to another page. I have achieved this but I want a better soln.

I am using javascript to pass and retrive values. I pass the textfield values to a global javascript files and retrive the values on another page from this global file. I am calling a function in javascript on submit button and getting all the textfield values.

I would like to know is a way i can pass the values from one page to another without involving global.js file, just like we do in jsp files.(eg request.getParameter()). Also how do I post the data in Ajax. ie. is there a way of posting data in Ajax.

Another query I have is : if my html files have some javascripting in it, it is never called, the scripting has to be present only in one place ie global.js, why is this and why cant I have scripting in every html pages.

Your contribution will be greatly appriciated.
[ November 21, 2006: Message edited by: Bear Bibeault ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Any basic tutorial on the XMLHtpRequest shows how to post with the send() method.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing parameter in ajax