我发送ajax请求时收到错误403

时间:2022-04-22 21:54:11

This is the javascript code

这是javascript代码

    var parent = $(this).parent().parent().parent();
    parent.find('.archiveSpinner').css('display','block');
    var title = $(this).attr('data-title');
    var desc = $(this).attr('data-desc');
    var source = $(this).attr('data-source');
    var datePublished = $(this).attr('data-datePublished'); 
    var _title = parent.find('.title').html();
    var _desc = parent.find('.description').html();
    var _source = parent.find('.source a').attr('source');
    var _datePublished = parent.find('.date').attr('date');
    var serverPage ="archiveThisNow.php?title=" + title + "&desc=" + desc + "&source=" + source + "&_title=" + _title + "&_desc=" + _desc + "&_source=" + _source + "&datePublished=" + datePublished + "&_datePublished=" + _datePublished;
        //the Json Request    

        $.get(serverPage,
                function(data) {
                    if(!data){}
                    else{
                            parent.find('#archiveError').hide();
                            $(data).appendTo(parent);
                            parent.find('.archiveSpinner').css('display','none');
                            setTimeout(function (){ parent.find('#archiveError').fadeOut('slow'); },5000);
                        }
                    });

it works perfectly offline but when i upload it to the server online i get this error

它完全脱机工作,但当我上传到服务器在线时,我得到这个错误

Forbidden

You don't have permission to access /archiveThisNow.php on this server.

您无权访问此服务器上的/archiveThisNow.php。

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。

Please i need help on this ASAP. Thank you

请尽快得到帮助。谢谢

1 个解决方案

#1


0  

Does the var serverPage have the correct path to the page. Remember it's relative to the html/php file that is calling it, not the javascript file that this might be in.

var serverPage是否具有该页面的正确路径。记住它是相对于调用它的html / php文件,而不是它可能在的javascript文件。

#1


0  

Does the var serverPage have the correct path to the page. Remember it's relative to the html/php file that is calling it, not the javascript file that this might be in.

var serverPage是否具有该页面的正确路径。记住它是相对于调用它的html / php文件,而不是它可能在的javascript文件。