How to use Ajax in Smarty? -
this ajax request
<script type="text/javascript"> {literal} $(document).ready(function(){ $("#s1").change(function() { var idcat=this.value; alert(idcat); $.ajax({ type: "get", url: 'product_modify.php', data: {idcat:idcat}, success: function(data) { alert(data); alert("success"); } }); }); }); {/literal} </script>
and php codes
if(isset($_get['idcat'])){ $idc= $_get['idcat']; echo $idc; }
there problem echo $idc; doesn't work ? problem ?
var idcat=this.value;
should be
var idcat=$(this).val();
Comments
Post a Comment