Strange jQuery Ajax Issue

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.

// Load page inner
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">&times;</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:

// Internal site links
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 enter image description here

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

+4
source share
2

, :

( .htaccess, , ), . , .

!

0

, @Alexandre Reiff Janini, , , .

, firebug, ( mozilla), -, DNS , htaccess.

EDIT: , ,

.htaccess, , , , . , .htaccess,

, , httpd.conf, . htaccess-limt, htaccess, , - Apache

0

Source: https://habr.com/ru/post/1542201/


All Articles