Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> JavaScript >> Snippet

Pass data to a new HTML file


..When a URL is called using the get method, the query string is contained in
the location.search property of the new page.

An HTML page can send a get request by setting the .href property of the location object :

document.location.href = " http://www.garybeene.com/newpage.htm?first=hello &second=newcomer"

The new page could retrieve the "?first=hello&second=newcomer" from the
location.search property like this :

alert ( location.search )