I have two page page1.php and page2.php, on page1.php i click on a href and that link to page2.php somewhere…
in the page2.php there is 4 expander, hidden or close on pageload…
question : i like to pass from page 1 to page2 which of the expander i like to see OPEN
something like page1 href=”page2.php?open=1″
and on page2.php a jquery that retreive the open var, and after pageload expand only that one…
i have research google and come with that : https://github.com/allmarkedup/jQuery-URL-Parser
is it possible to do that without plugsin ?
The specific answer:
But if your intention here is to link to a specific part of the page, then URL fragment is more appropriate. Given the URL
/page2.php#expander1you can retrieve theexpander1part withlocation.hash.substr(1).