[eluser]yyzSantaBarbara[/eluser]
The code listed below successfully POSTS using JQUERY AJAX on my localhost. I am creating a JQueryMobile web site. However, when I moved this web site to the production server that is on the internet I have problems getting the $.(Post) to execute. I have looked in the debugger tools on IE and chrome and cannot see the POST call go through on the production server. On localhost the same code works as expected.
Has anybody encountered such a problem. I am using the CI version 2.1.3 on both local and Production. I forgot to check the versions of Apache but I believe the Production version is a little more recent. I think the problem is likely a CI configuration settings that I am missing, though both the local and production servers are using the same configuration files, expect for the base URL setting.
Code:
$(document).ready(function()
{
$("#validate_credentials").validate();
});
$('#btn_login').click(function()
{
console.log("Login has been clicked: " + '<?php echo site_url('/login/validate_credentials'); ?>');
$.post('<?php echo site_url('/login/validate_credentials'); ?>',
{
'user':$('#user').val(),
'pass':$('#pass').val(),
'ajax':1
},
// When CodeIgniter responds to the request
function(data)
{
console.log("validate_credentials returned: "+ data);
// clear any message that may have already been written
$('#validation_message_target p').html('<p></p>');
var n=data.search("<title>Welcome to CodeIgniter</title>");
if (n > 0)
{
var url = '<?php echo site_url('/activity/stock_search'); ?>';
$.mobile.changePage( url, {
type: "get",
showLoadMsg : true
});
}
else
{
var x = '<p class="required">'+data+'</p>'
$('#validation_message_target p').html(x);
}
});
});