I am createing a test web page that will retrieve a report using visualize.js and displays it in a div. When I run the code in JSFiddle it works fine. But when I load it as a web page the report would not load, the browser console window displays:
TypeError: t is null
...ion h(e){var t=e.toLowerCase().match(j),i=t[2],n=t[3],r=t[4]||"";return("http:"=...
An error gets tirggered when the page is loaded through a web page (both Firefox & ie triggers the same message); but not when executed through JSFiddle, the reports loads successfully, huh!!! Please see the code below for .html & JSFiddle. Hope I provided enough info. Thanks for your help in advance!
.HTML code:
<html>
<head>
<meta charset='utf-8'>
<script src="http://localhost:8080/jasperserver-pro/client/visualize.js" type="text/javascript"></script>
<title>jRxCONNECT</title>
</head>
<body>
<div id="container" style="border: 0px #eee solid; min-height: 5px; min-width: 100px; background: #fff; padding: 0px; "> </div>
<script>
try{
visualize({
auth:{
name: "xxxxx",
password: "xxxxx"
}
}, function (v){
report = v.report({
resource: "/public/Samples/Reports/01._Geographic_Results_by_Segment_Report",
container: "#container",
params: {"parProductId":["34"]},
error:function(err){
alert("Rep Err: " + err.message);
}
}
);
}, function (v){
alert("err");
}, function (v){
}
);
}catch (ex){
alert(ex.toString());
}
</script>
</body>
</html>
JSFiddle Code:
JSFiddle HTML Code:
<script src="http://localhost:8080/jasperserver-pro/client/visualize.js" type="text/javascript"></script>
<div id="container" style="border: 0px #eee solid; min-height: 5px; min-width: 100px; background: #fff; padding: 0px; "></div>
JSFiddle Javascript Code:
try{
visualize({
auth:{
name: "xxxxx",
password: "xxxxx"
}
}, function (v){
report = v.report({
resource: "/public/Samples/Reports/01._Geographic_Results_by_Segment_Report",
container: "#container",
params: {"parProductId":["34"]},
error:function(err){
alert("Rep Err: " + err.message);
}
}
);
}, function (v){
alert("err");
}, function (v){
}
);
}catch (ex){
alert(ex.toString());
}
Using the IP address instead of localhost worked! FYI: OS is Windows7.