page1 or page2 on same server.
page1:
<div id="id_div">
</div>
page2:
getid=id_div
I don't care in what programming language, but how to catch id from another page ?
page1 or page2 on same server.
page1:
<div id="id_div">
</div>
page2:
getid=id_div
I don't care in what programming language, but how to catch id from another page ?
You can do it with jquery :
$.get('http://example.org/page.html', function(data) {
alert($(data).find('div:first').id)
});
For instance, if you want all the ids of the div elements in this page, you can do :
$.get('http://stackoverflow.com/questions/3388180/how-to-catch-id-from-another-page/3388188', function(data) {
list = [];
$(data).find('div').each(function(index, element) {
list.push(element.id);
});
alert(list);
});
Pass the id_div parameter in ther url as query string.
http://www.someaddress.com?theid=id_div
anything after the ? is a query string. theid in the url above is the identifier and the bit after the = is the value. You can pass multiple values by using ampersands:
http://www.someaddress.com?theid=id_div&theuser=user2032&activated=1
The you can use a server side language or javascript to do something with this on page2.