Network Error 403 Forbidden Ajax
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss jquery ajax post 403 forbidden the workings and policies of this site About Us Learn more about jquery ajax 403 forbidden error Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow 403 forbidden error in ajax post call Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each ajax get 403 forbidden other. Join them; it only takes a minute: Sign up AJAX 403 forbidden when making ajax request up vote 4 down vote favorite The website initiates ajax request but always get return 403 error for all browsers. I tested it by initiating the same call in firebug console, it works (status: 200) What is the problem can be
403 Forbidden Ajax Call
deduced? jQuery.ajax({ url: "cart_ajax_get_product.php", data: {id: 355, qty: 1}, success: function(data) { }); }, error: function(err) { } }); Thanks ajax general-network-error share|improve this question edited Jan 28 '13 at 4:06 Musa 66.2k106384 asked Jan 28 '13 at 3:11 Ictuser Ai 2113 Can we get some of your code to help you out better. –AgnosticDev Jan 28 '13 at 3:12 403 is a permissions error, which could stem from the AJAX method expecting a post request instead of a get request from your browser. But without code or at least a link to the page that's causing the problem, we can only guess. –cliffbarnes Jan 28 '13 at 3:38 jQuery.ajax({ url: "cart_ajax_get_product.php", data: {id: 355, qty: 1}, success: function(data) { }); }, error: function(err) { } });
–Ictuser Ai Jan 28 '13 at 3:43 I asked my hosting company,,, and got reply that my website violate some restriction rule detecting for sql injection by mod_security .... it should relate to cookies, raw: "%7B%22cart%22%3A%5B%7B%22id%22%3A305%2C%22qty%22%3A1%7D%5D%7D", value: "{"cart":[
in the picture below. Send Cancel From : guestTo : Subject : Content : Type the characters you see in the picture below. Send Update CancelFeedbackEmail IDSubject : Comments : Send CancelPrivate MessageType the characters you see in the picture below. Type the characters you see in the picture below. Attach files Desktop Zoho Docs Google Docs Each Attachment size should not exceed 1.0 MB. Max no of attachments : 3Loading User Profile... guest Response titleThis https://forum.jquery.com/topic/ajax-problem-networkerror-403-forbidden-6-12-2011 is preview!Attachments Publish Back to edit Cancel ()Sign In New to this Portal? Click here to Sign upYou can also use the https://elgg.org/discussion/view/2015368/error-403-forbidden-when-sending-ajax-request below options to loginLogin with FacebookLogin with GoogleLogin with Yahoo jQuery Plugins UI Meetups Forum Blog About Donate All Forums Recent Posts Log In Search jQuery Search jQuery Forum Move this topicForum : Getting StartedUsing jQueryUsing jQuery PluginsUsing jQuery UIDeveloping jQuery CoreDeveloping jQuery PluginsDeveloping jQuery UIQUnit and TestingAbout the jQuery ForumjQuery ConferencesjQuery MobileDeveloping jQuery Mobile Sub forum : Move this topic Cancel Using jQuery khalednet.. ajax problem - NetworkError: 403 Forbidden in Using jQuery • 4 years ago hi,in asp.net 4.0 c#,I have master page and 403 forbidden I need to call ajax function to get some data from server, so I have this jquery function: $("#save_email_db").live({ click: function (event) { event.preventDefault(); var email = $('#email_newsletter').val(); if (IsValidEmail(email)) { $.ajax({ type: "POST", url: "MasterPageMain.master/SaveEmail", data: 403 forbidden error email, contentType: "application/json; charset=utf-8", dataType: "json", timeout: 7000, success: function (msg) { var res = msg.d; alert(res); if (res == "Added Successfully!") { } else { } }, error: function (xhr, status, errorThrown) { } }); } } });now, in master page behind code (C# code) I have this function in to be called by ajax: [System.Web.Services.WebMethod] public static string SaveEmail(string name) { try { return "Added Successfully!"; } catch (Exception ex) { return "DB Error, Contact us Please!"; } }now when I call run the code, I'm getting this error:"NetworkError: 403 Forbidden -http://localhost:6160/leamratech4/en/MasterPageMain.master/SaveEmail"so what is the problem, and how can I solve it? 1 Reply Replies(1) jay.blanc.. Re: ajax problem - NetworkError
sending ajax request Azartech@azar.developer 0 likeserror 403 forbidden when sending ajax requestBy Azartech 623 days ago Replies (4) Hi again.I'm developing a locations plugin for my projectI have a select box for states that lets user select a state from available options. Whenever the user makes a selection an ajax request is send to server for fetching a list of cities for a specific state. I'm using firebug for debugging ajax calls. I'm receiving 403 error and see no results.I have this snippet in my start.php file:elgg_register_ajax_view('locations/cities');and here is my snippet code for ajax request:$("#states").change(function() { stateId = $("#states").val(); $.ajax({ type: 'GET', dataType: 'html', cache: false, url: ""+'ajax/view/locations/cities?stateId='+stateId, success: function(data) { alert('Call Success'); } }); });and finally here is the content of cities.php ajax view (mod/locations/views/locations/cities.php):state_id = (int) get_input('state_id'); echo "This is a test";I studied the galliComments plugin and much of these code is similar to it, But I wonder why i am receiving this error?Replies Cim@manacim 0 likesBy Cim 623 days agoDid you forget to make default folder?mod/locations/views/default/locations/cities.php Azartech@azar.developer 0 likesBy Azartech 623 days agoThe problem was that I placed the call to elgg_register_ajax_view in page_handler function. It should be placed in init function.But there is another problem. I don't receive output from this call. The output is empty.$("#states").change(function() { stateId = $("#states").val(); $.ajax({ type: 'GET', dataType: 'html', cache: false, url: ""+'ajax/view/locations/cities?stateId='+stateId, success: function(data) { if(data.length>0){ alert(data); } } }); }); Steve Clay@steve_clay 0 likesBy Steve Clay 623 days agoJust open the URL in your browser http://example.com/ajax/view/locations/cities?stateId=10If you don't get an error, the view isn't registered. If you get nothing, maybe you're missing the echobefore the elgg_view() in your view.If you get what you want, then I'm not sure