Goal: Get a specific HTML element ul’s id value from a ul class called SBUpdater
Purpose: My program contains several server url’s and parses specific information that I need from each server url. Each id of a ul contains the value of a server url. I need to take this ID value so i can update that specific ul tag and update the content on the screen (without refreshing the page).
In a php file I have the following:
Example Code:
<ul id="http://server1.com" class="SBUPdater">
<li> ... </li>
</ul>
<ul id="http://server2.com" class="SBUPdater">
<li> ... </li>
</ul>
All I need is a method of getting this id value from the ul tags.
Known:
- Tag = ul
- Class = SBUpdater
- ID = ?
What I would like is to retrieve every ul’s id value, take all ul id’s, perform a function with them, and then repeat the process every 10 seconds.
With prototype library you would do this:
Each
ulelement would use thedata-url(notid) attribute to hold the URL of your server script. That script would then return the new content of the appropriateulelement.Thanks to Nick Craver for excellent suggestion