JXON library usage

maxmustermann

New Member
I am getting following error in Opera next when trying to use JXON library provided in github. Any solution, please help : \[code\]Uncaught exception: DOMException: NETWORK_ERR Error thrown at line 230, column 3 in <anonymous function: JXONParser.prototype.parseXMLFile>(url, callback) in file://localhost/D:/selfstudy/22mar/JXON.js: if(xhr.status != 200) called from line 15, column 4 in myFun() in file://localhost/selfstudy/22mar/test1.html: jxon = parser.parseXMLFile("D:/selfstudy/22mar/sample.xml") called from line 1, column 0 in <anonymous function>(event) in file://localhost/D:/selfstudy/22mar/test1.html:myFun().\[/code\]Code as below: test1.html : \[code\]<!DOCTYPE html> <html lang="en"> <head> <title>Welcome</title> <script type="text/javascript" src="http://stackoverflow.com/questions/15564122/JXON.js"></script> <script type="text/javascript"> function myFun() { var parser = new JXON.Parser(); var jxon = null; jxon = parser.parseXMLFile("D:/JCI/Study&Training/selfstudy/22mar/sample.xml") alert(JSON.stringify(jxon)); var jsonMsg = JSON.stringify(jxon); console.log(jsonMsg); } </script> </head> <body onload="myFun()"> Hello </body> </html> \[/code\]JXON.js from here :
https://github.com/DMGambone/JXON-Parser sample.xml: \[code\]<?xml version="1.0"?> <!DOCTYPE catalog SYSTEM "catalog.dtd"> <catalog> <product description="Cardigan Sweater"> <catalog_item gender="Men's"> <item_number>QWZ5671</item_number> <price>39.95</price> <size description="Medium"> <color_swatch image="red_cardigan.jpg">Red</color_swatch> <color_swatch image="burgundy_cardigan.jpg">Burgundy</color_swatch> </size> <size description="Large"> <color_swatch image="red_cardigan.jpg">Red</color_swatch> <color_swatch image="burgundy_cardigan.jpg">Burgundy</color_swatch> </size> </catalog_item> </product> </catalog> \[/code\]I have already enabled - Allow File XMLHttpRequest in opera. Thanks
Sneha
 
Back
Top