Link to home
Start Free TrialLog in
Avatar of Arnold Layne
Arnold LayneFlag for United States of America

asked on

How to parse and organize html ajax results with jQuery

I have an html page that uses jQuery to perform $.get calls to an asp.net page. The asp.net page looks up info from the database and returns a snippet of html code to the calling page, with no html tag, body tag....etc, just the specific snippet. I will use the html snippet that the page returns to parse info from it and plot points on a google map.

Here is what my page will currently return. Usually it will return this for more than one user. For every user the database finds, it will return the following html
<ul id="this is filled in with a different id value from database for each user it finds">
    <li></li>
    <li></li>
    <li></li>
</ul>

Open in new window


There are three other values of each record returned from the database query besides the user id. These are represented in the list items. All 4 values are from the same record, but the ID value is the wrapper or ul part because that is the unique value of the record returned.

The three other values for the list items are Name, Lat, Lng.

How do I access these values and get them into javascript variables for google maps marker plotting?

I don't need to know the plotting part, just the best way to get these values into usable variables by parsing the very simple html snippet that will be returned.

I CAN count on the order in which these li values appear, so things like first-child could work. Or, I could use an id system and add that to the ouput html snippet. I don't know which is best. Looking for a good idea
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Arnold Layne

ASKER

Hi Rainer. Is there any subject you don't know about? LOL.
Yup, there are so many:
Linux / Unix, Java, SAP, Oracle, ...
Pretty all that is not directly created/used by any kind of Microsoft technology :-D

Thanks for the points.

HAND
Rainer
Well I wouldn't call a good understanding of jQuery to be Microsoft. Thanks again.
Well, since SharePoint is using it out-of-the-box :-)

I really like the possibilities of client side scripting - e.g. dependant drop-downs in MOSS 2007 with the "simple" injection of jQuery and the SPServices JS library.

"Easy" to do, less deployment hazzles but the hell to debug ...