php - Calling Codeigniter Controller function inside the jquery -
i want specify controller path inside .ajax function of jquery.
type:'post', url:"<?php site_url('login/validate'); ?>", //datatype: "json", data:data1, success: function (response){ //alert (response); $("span.error").html('congrats! registered our site').addclass('error'); //window.location="site"; },
currently doing path taken string. going success function dont know whay? when alert response gives error of "disallowed key characters"
this due url:"<?php site_url('login/validate'); ?>",
create url:"",
you need echo
url.
url:"<?php site_url('login/validate'); ?>",
change to
url:"<?php echo site_url('login/validate'); ?>",
or
url:"<?= site_url('login/validate'); ?>",
Comments
Post a Comment