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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -