I get a strange ajax problem ... well ... not a problem, but you will see / hear / read
Here is the code that I use to pull the page, you can see that I use "POST" to pull it in.
function LoadPageInner($url, $cont){
var $loading = '<div class="pageLoader">Loading...<br /><img src="/assets/images/ajax-loader.gif" alt="loading..." height="11" width="16" /></div>';
var $container = jQuery($cont);
var $t = Math.round(new Date().getTime() / 1000);
var options = {
url: $url,
cache: false,
type: 'POST',
beforeSend: function(){
$container.slideUp('fast', function(){
$container.slideDown('fast').html($loading);
});
},
success: function(data, status, jqXhr){
$container.slideUp('fast', function(){
$container.slideDown('fast').html(data);
});
},
error: function(jqXhr, status, error){
$container.slideUp('fast', function(){
$container.slideDown('fast').html('<div class="alert alert-danger alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><i class="fa fa-exclamation-triangle fa-4x pull-left"></i><p><strong>Danger Will Robinson!</strong><br />There was an issue pulling in this page. Our support team has been notified, please check back later.</p></div>');
});
}
};
jQuery.ajax(options);
}
And in order to use it, my links have a class called is-ajaxand start when loading windowas such:
var $a = $('a.is-ajax');
$a.click(function(e){
e.preventDefault();
var $this = $(this);
LoadPageInner($this.attr('href'), $this.attr('data-where'))
});
Now I look at firebug, and it POSThappens with the page to which I am trying to connect, but the header attached to it 301 Permanantly Moved, and then under it is GETthe same page

How can I guarantee that this will not happen, or how to fix it?
Kevin source
share