Good evening,
On the main page, I have some stations with a link to get the graph of the measures of the station On the graph page I need to get the ID of the station before making a request to the data base.
for example, a link can be as the following
<a href="#graph" data-inline="true">see the graph</a>
But how can I specify the id of the station? Should it be
<a href="#graph?id=2" data-inline="true">see the graph</a>
or should it be a data-id (or somethings similar)
<a href="#graph" data-id="1" data-inline="true">see the graph</a>
Next, of course, I need to get the ID form the #graph page to use it in my MySQL request
$( document).on( "pagebeforecreate", "#graph", function( e ) {
$('#containerChart').css('height', Charts.resize() +'px');
});
I beleive, Jquerymobile has a fonction for that isn't?
Could you help me this ?
EDIT: In other words with PHP, I would create a link on the source page:
<a id="source" href="target.php&id=3>target page"</a>
and on the target page, I would write this, to get the ID
<?php echo $_GET['id']; ?>
I need to do the same with jquerymobile. Ma source page is #home and ma target page is #graph
Many thanks
Thanks a lot. It's help me a lot, that's was the answer.
I make it simpler and this works well (let I know if we can make better)
On the source page:
The function to parse the URL parameter. It's very nice!!
The handler:
That works fine. Thanks for your help!!