All Questions
20 questions
0
votes
1
answer
516
views
jQuery async/await Ajax call, without triggering an exception on HTTP <> 200?
I'm trying to make an async/await HTTP POST using jQuery like this:
let response = await $.post({
url: 'https://example.com/product/add',
data: JSON.stringify({"foo":"bar"}),
...
0
votes
1
answer
101
views
Get Java exception class name in javascript
I am using following code to call java web API
m$.ajaxq({
url: contextPath + "/updateElapsedTime",
type: "POST",
data: params,
contentType: "application/json; charset=utf-8",
dataType: '...
-1
votes
1
answer
495
views
javascript alert TypeError
In the following javascript code,
needSubIdCheck = $("#needSubIdCheck").text();
liveSupplierCount = $("#liveSupplierCount").text();
subIdCount = $("#subIdCount").text();
...
0
votes
0
answers
73
views
Why isn't JavaScript throwing exceptions as the result of an asynchronous HTTP (AJAX) request?
I've written the following JavaScript function which is very simple, it takes an ID and which then is sent to a PHP page, which echoes out some JSON. It passes the ID into the PHP page via GET.
For ...
1
vote
1
answer
135
views
How can I bubble an error from an $.ajax instance to the $.ajaxSetup?
I have an error callback defined in ajax setup, that will be executed in each ajax instance:
$.ajaxSetup({
cache: false,
error: function (data, textStatus, pStatusDescription) {
if (...
1
vote
1
answer
756
views
How to handle server/connection exceptions with React and Redux thunk in a maintainable manner
I'm using Redux thunk to dispatch asynchronous actions like fetching and posting to server. Each action creator call returns a promise, which resolves when after ajax has done it's magic and Redux has ...
14
votes
3
answers
3k
views
Spring MVC - RequestParamException parameter is not present
I've got an issue that occurs eventually in my website. It uses AJAX requests to get data from the server, which uses Spring MVC.
What happens (intermittently) is that sometimes we got an exception ...
0
votes
2
answers
61
views
How to call an exception with post method (AJAX)?
If the post method is unsuccessful I want to throw an exception and write to an error log? Basically if this method returns no results I want to throw an exception and write to file.
Post method:
$....
79
votes
6
answers
109k
views
How to catch net::ERR_CONNECTION_REFUSED
Is there a way to catch failed to load resource: net::ERR_CONNECTION_REFUSED, I've tried:
try {
$.post('',{},function(res) {
}).fail(function (xhr, textStatus, errorThrown) {
xhr.textStatus ...
6
votes
1
answer
10k
views
XMLHttpRequest.open() exception handling
I have the following piece of code (only relevant parts):
xhttp=new XMLHttpRequest();
xhttp.open("GET",doc_name,false);
xhttp.send();
xmlDoc=xhttp.responseXML;
if(xmlDoc==null)
{
xmlDoc=loadXMLDoc(...
2
votes
2
answers
3k
views
How to suppress this JavaScript error: Exception : TypeError: $("j2t-temp-div").down(".j2t_ajax_message") is undefined?
To reproduce this error, please kindly go to here.
Select "Color" and "Size" and click "Add to Cart", when the "loading..." dialog box appears AND before it turns into the "added to cart" dialog box, ...
2
votes
5
answers
442
views
Logging try{ ... } catch(e){ ... } using ajax : possible?
When I try the following in the chrome console, i get 'undefined' as the value of 'e':
try{
var test=somethingInvalid();
}
catch(e){
console.log(e);
}
How do I access the details of e?
What ...
1
vote
3
answers
722
views
Javascript loaded through jQuery Ajax does not throw expected exceptions in Firebug
I have a Javascript functions which throw exceptions if something goes wrong. I have so used to this behavior, that one day it took me more than 20 minutes to find the error in code because the ...
2
votes
2
answers
1k
views
How to properly generate exceptions in PHP/Dojo when returning javascript code
I am having difficulty understanding how exceptions are handled when code is fetched dynamically via AJAX and executed via eval. With clientside javascript, it is rather simple, if I have a piece of ...
2
votes
1
answer
2k
views
Cant get info from FaultExceptions (javascript)
Until now I have used an webservice ASMX which I call from javascript. It has been working fine, but because I needed some control over the serialization, I am trying to switch to DataContracts and ...