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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -