This repository has been archived by the owner on May 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
catching the jQuery parseXML exception #11208
Labels
Comments
|
(But the expectation would be: "yes, it should".) |
Actually, my example with just
console.log('Started');
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js", function() {
console.log('Loaded jQuery');
page.evaluate(function() {
try {
console.log('Parsing XML');
var doc = jQuery.parseXML('<foo></foogoo>');
console.log('XML is valid? ' + (doc.length == 1));
} catch(e) {
console.log(e.message);
}
});
phantom.exit();
}); The same JavaScript code is working as expected on jsFiddle http://jsfiddle.net/u4Amm/ |
Currently experiencing this issue too.
|
I'm also experiencing this issue. Is there any workaround for this?
|
Code working properly
Result:
|
ghost
removed
old.Module-WebPage
labels
Dec 19, 2017
Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm not sure if it's an issue, but shouldn't the following code throw an exception and reach the catch block?
try {
jQuery.parseXML('foo');
} catch(e) {
console.log(e.message);
}
The text was updated successfully, but these errors were encountered: