POST values Do not Go through to DataTable (403 Error)
POST values Do not Go through to DataTable (403 Error)
zgoforth
Posts: 493Questions: 98Answers: 2
I have created an html form to read and post data to the corresponding SharePoint list. Im positive I have the code correct, but when I execute it in SharePoint, I get a 403 error. And the JSON Object it writes doesn't appear in the console like it should. Here is my code, I don't have the proper SharePoint urls inserted because they don't work on external sources outside of SharePoint. Now I can't even get the JSON to show up in the console on the JSFiddle either
This discussion has been closed.
Replies
The 403 error is something you will need to troubleshoot on the server side. HEre is some information on the error:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
You will need to look at the server logs to find out why its responding with the 403 error.
Kevin
Now I found out the issue(or at least I think I did) here, but when I click submit on the button to populate it to the DataTable, the page refreshes, which it didn't do before, and now it still gives me the
error
DevTools failed to load SourceMap: Could not load content for https://oneshellprcorp.blob.core.windows.net/oneshellpr/20200909.1/chat.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
Here is my JavaScript code
That is a Source Map error and is not related to your Ajax request. See this tutorial about Source Maps.
Start by using the browsers network inspector tool to see what the request and response is.
Kevin
@kthorngren I read the article and enabled the CSS Source Maps because some browsers don't always have it enabled. That did nothing to the populate the DataTable. It runs but just wont send my new item to the SharePoint list which would cause it to update the DataTable just like I planned
Didn't expect the Source Map to fix you problem. Like I said its not related to your issue.
Its hard to say what the problem would be just looking at your code snippet. Please post a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
In fact in looking at the above code snippet I don't see anything that includes Datatables code. If your test case https://jsfiddle.net/p6rkmez0/ shows the issue please provide information of what to look at or steps to take to see the issue.
Kevin
@kthorngren Ok, will do. https://jsbin.com/fehedigaqu/edit?html,output take a look at this one, once I submit the data, it actually shows up in the console unlike the JSFiddle I had linked. I cannot use the sharepoint urls as I am not creating the test case within SharePoint, so they are useless. Now I just need to be able to figure out this step, which is where I think the issue comes into play
The example doesn't contain a DataTable, so it would be worth asking on StackOverflow or a more appropriate forum,
Colin
This error indicates that the server has determined that you are not allowed access to the thing you've requested, either on purpose or due to a misconfiguration . It's probably because the site owner has limited access to it and you don't have permission to view it. The vast majority of the time, there's not much you can do to fix things on your (*client) end. There are three common causes for 403 Forbidden error (server side) . Here they are listed from most likely to least likely:
If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials. However, a request might be forbidden for reasons unrelated to the credentials.