views:

33

answers:

2

Hello Everyone.

I am new to Jquery. I want to read specific data(some div's only) from a webpage and store it in my database. Now I am not able to do so as load functions loads the data into the current page id. My goal is to read specific data and store them in database. So which Jquery function should I use for this? if someone can throw some light on it, it would be really helpful for me.

I am using JSP,MySQL,Java.

A: 

If you just include the tag name of the control in the JQuery function then it will only search for that type of control. Like the following will fetch all the divs

var divArray = $("div"); 
azamsharp
A: 

jQuery is a client side library so you are not going to use jQuery to store data in a database.

You can use jQuery to do a post, $.post() and send some data to the server where your servlets can then store it in the database for you. Here is a page that describes using the post function.

You should be able to grad data from the page with the jQuery selectors and submit that data with post.

Vincent Ramdhanie
Thanks for your reply Vincent. I am not able to grad data from the page either using Jquery. If say I want to read some div tags of a page and want to store it in some variable, that is not working either for me. Can you tell me how to read specific data from a webpage into a variable(in different page)?
On a different page? Are you saying that you want to submit data from one page and access it on a second page? Can you say how the data is on the the page? Is it entered by the user in a form?
Vincent Ramdhanie
Lets say there are two webpages named abc.html and xyz.jsp..... On xyz.jsp page I want to read one div tag of abc.html page(Read and not load, so that i can work on that data read). Now how to go about it?