In my header.php
file I have many jQuery functions like change form on button click.
Everything is working fine, but two jQuery functions, that have ajax involved, do not work fine when I load the page by typing link in the browser. But they work fine when I load the page by clicking on the link on other page.
Here is my jquery code :
<script>
$(document).ready(function(){
$('#email_s').change(function(){
var email = $('#email_s').val();
if(email != '')
{
$.ajax({
url:"<?php echo base_url(); ?>Home/checkuser",
method:"POST",
data:{email:email},
success:function(data){
$('#emailseller_result').html(data);
}
});
}
});
$('#username_s').change(function(){
var username = $('#username_s').val();
if(username != '')
{
$.ajax({
url:"<?php echo base_url(); ?>Home/checkusername",
method:"POST",
data:{username:username},
success:function(data){
$('#userseller_result').html(data);
}
});
}
});
});
</script>