jQuery Ajax pull data from a Form request on another page?
I want to grab some elements of a page using jQuery and ajax...no problem. However, the elements do not appear until a user clicks a button in the form, so essentially I cannot pull anything off the page unless that is executed. Anyone know how this can be achieved? I will post samples and what I am trying to accomplish.
I want to pull data from all orders 12 months previous (value=12). This is the form that is given on the page:
<form action="" method="post" name="form2">
<table>
<tbody><tr>
<td align="center"><span><b>Order History</b></span></td>
</tr>
<tr>
<td>
<table>
<tbody><tr>
<td width="235"开发者_运维知识库>
<select name="date">
<option selected="" value="1">Orders placed in the past 1 month</option>
<option value="3">Orders placed in the past 3 months</option>
<option value="6">Orders placed in the past 6 months</option>
<option value="12">Orders placed in the past 12 months</option>
<option value="2011"> Orders placed in 2011</option>
<option value="2010"> Orders placed in 2010</option>
<option value="2009"> Orders placed in 2009</option>
</select>
</td>
<td width="43">
<input type="image" border="0" src="v/vspfiles/templates/4/images/Template/btn_go.gif" name="imageField">
</td>
</tr>
</tbody></table>
<br>
</form>
Once the data is displayed, the url does not change so it is still '/orders.asp', but I want to then grab that data using ajax. Is this possible?
Right now one has to go to their My Account page, then they have to click a link which takes them to their Orders page where this form is located. I want to automatically display thier most recent orders on their My Account page.
I'm not clear where you're stuck.
One can wire some JavaScript that will execute when the user selects any of the options (eg.12)
The Javascript can initiate an Ajax call - this retrieves some data
The ajax call hits a service on the server that gathers some data , which should be just data, not HTML
When the Ajax call completes some more javascript can look at the response, and manipulate the DOM in the browser to present the data.
From your question I can't figure out where you need the help.
精彩评论