php - Ajax load content with jquery (URL trigger) -


i'm trying create demo bar wordpress theme companies .so far, able achieve bit of with

$('#window').load('index.php?action=theme&themeid=5'); 

now want able create specific urls trigger specific code. example, above mentioned code runs if go

http://mysite.com/theme.php?id=5 

how do that? there way same php?

easily done php, have echo $_get['id'] value inside script:

echo "<script type='text/javascript'>$('#window').load('index.php?action=theme&themeid=".$_get['id']."');</script>"; 

or

<script type='text/javascript'>     $('#window').load('index.php?action=theme&themeid=<?php echo $_get['id'] ?>'); </script> 

reference

and yes, get parameters unsafe, post parameters may manipulated. should valid check if parameter being passed valid in php page beforing echoing directly script.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -