javascript - How can I load PHP GET values using jquery .load() -
I'm trying to load data from another page. The data I am trying to load is a simple PHP $ _ GET
value that was passed through the URL
$ _ GET
The value should be loaded when the following link has been clicked
When I use the following href link only data loads:
& Lt; An id = "pizza" href = "#" & gt; Pizza & lt; / A & gt;
However when I use this href tag
The content is not loaded I came to know that this is not loading because I set the content to be displayed only when the link is clicked in such a way. .
& lt; Script & gt; $ ("#pizz") ("Click", function () {$ ("# item_description"). Load ("item-description.php");}) & lt; / Script & gt;
The problem is that when I click on the link it starts a new XHTTP request and
$ ("# item_description") Does not reach. Load ("item-details.php");
Because nothing is being clicked when there is a new XHTTP request
The item-detail page only resonates the value that was sent
& lt ;? Php echo $ _GET ['test_val']; ? & Gt;
- Text "itemprop =" text ">
use
& lt; id = "pizza" href = "#" & gt; Pizza & lt; / a & gt;
To keep and you can use
$ ("# item_description"). Load ("item-details.php? Myvar = 1 & mysecondvar = 2");
/ code>
Required
Comments
Post a Comment