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> 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
Post a Comment