mat001 Posted October 23, 2014 Share Posted October 23, 2014 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());} Link to comment Share on other sites More sharing options...
Solution hozawa Posted October 25, 2014 Solution Share Posted October 25, 2014 Which OS are you using? Windows8.x have problem with "localhost". Try replacing it with IP address. Also, check if Visualize.js script file is being loaded. Link to comment Share on other sites More sharing options...
mat001 Posted October 27, 2014 Author Share Posted October 27, 2014 Using the IP address instead of localhost worked! FYI: OS is Windows7. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now