I wrote a processing sketch for depicting the parallel coordinates visualization. The problem is that though it works fine in Java mode but shows a blank screen in JavaScript Mode. Can someone tell me what the problem is? I am using Processing 2.0. The error I receive in Firefox is as follows:
Use of getPreventDefault() is deprecated. Use defaultPrevented instead. # chrome://smarterwiki/content/jquery.js:3527
Error in parsing value for 'image-rendering'. Declaration dropped. # http://127.0.0.1:56763/
ReferenceError: Float is not defined # http://127.0.0.1:56763/processing.js:10175
I cannot provide the code because it's part of a homework I still need to submit. Also, seeing the last line, I tried to replace all the instances of the float type with var type in the JavaScript mode but it didn't help.
My problem was that I was using Float.isNaN() and Float.MAX_VALUE in parts of my code where I couldn't do without them.
I got this answer in the Processing forum which worked like a charm.
For MAX_VALUE:
http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.lang.Float.MAX_VALUE
And see also
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity
For NaN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN
Related
I have a simple pdf file containing an embedded file (test.xml) I'm trying to add a JS to call it once the pdf file is opened (even with notification to user to accept the risk etc). I've read that to perform that, the JS that should be used is this:
this.ExportDataObject({cName:"test.xml", nLaunch:2});
For some reason, it is not working. I checked the debug js console on my Acrobat reader DC (version 2021.001.20145) the the error shown is TypeError: this.ExportDataObject is not a function. I'm not sure why on my "this" object the ExportDataObject is not available... I think it should be available always, shouldn't it? I also tested without the this. and the error is different ReferenceError: ExportDataObject is not defined.
That makes to think to me that this.ExportDataObject is existing but is not a function as the original error said... but, if is not a function, what is? a typeof is showing "undefined". Not sure how to make this work. Not sure if next steps should more JS debugging or if the problem is related to something on pdfs or Acrobat. Any help? thanks.
Javascript function names are case-sensitive and as documented by Adobe (p. 151), the correct spelling is exportDataObject() without the leading capitalization.
I believe you misspelled ExportDataObject()
It should be exportDataObject()
Using Javascript you should be careful as it is easy to mess up spelling as JS will interpret that in different ways.
As like most of the languages, js is also case sensitive.
But ReferenceError: ExportDataObject is not defined, ReferenceError always states that the object is not defined at all, and could'nt be found among the class methods.
so you need to make sure the function with the exact exportDataObject name is present and use them accordingly.
I used webflow. Now there is a conflict when loading webflow.js.
What is the reason? How to fix?
http://s90009lu.beget.tech/teete/
https://i.stack.imgur.com/gx8sz.png
So even though the provided information is minimal i'm going to give it a shot:
As there is no actual sourcecode (code given seems to be packaged) i'm assuming this is some kind of a plugin. Which leads me to believe that this might not be the only case. Let just look at the exact error:
Uncaught TypeError: Cannot read property 'tram' of undefined
What this means is dat the browser tries to ook for a property called "tram" in an undefined variable. As undefined is something that is... wel... undefined. There can't be any properties. This produces this error.
A good practice to start of with some context might be just using a Google search of the exact problem. Let's search for "Uncaught TypeError: Cannot read property 'tram' of undefined".
Some results points up, al indicating stuff with webflow. Let's look at this result: https://forum.webflow.com/t/how-to-trigger-webflow-js-slider/11268.
The third post states that adding the line var $ = jQuery; got the user a step further. This provides some very clear context.
var $ = jQuery; assigns $ refer to the place in memory of the variable jQuery, a popular library. This basically creates an alias. Remarkable: $ tends to be a default (shipped) alias of jQuery. Something is off here.
Opening the browser (Chrome) developer tools shows the error shown in the screenshot. We can get some more precise information here by utilizing the debugger.
Open the devtools.
Click on a link to webflow.js to open it the sources tab.
Check the break on exceptions button (shaped like a stop sign).
Use the "{}" on the lower left to format the code.
Reload the page.
We can now see the code stop a certain point where it looks for tram. Just in front of that we see that it's looking in a newly created alias for window.$ (!).
The last thing makes to believe that indeed, jQuery is not properly installed. Either by the plugin or by a conflict in other modules. The suggested var $ = jQuery; line might work to fix this, but please keep in mind that jQuery should be made available first for this to work.
This last thing requires it to be bundled correctly or installed using a different method. As we don't know your exact situation you might need to look into this yourself.
I'm facing an issue while debugging my application. Following is the architecture:
Server: Java (Servlet)
Client: React+D3
Problem: Whenever, I change some react or d3 code and if an error occurs then it just shows me that some react (or d3) error has occurred but never tells me which function the error occurred (as seen in snapshot). Now, I know that simply debugging it by having the information like variable name and searching where I defined that variable. However, situation becomes tough when I use same object multiple times (say window) and had made several changes in the code. In this case, a specific line number where the error occured can be handy and quick. Let me know if I'm missing some basics about debugging such applications?
EDIT1:
1. In the snapshot, http://localhost:8080/..../Server Server is the main servlet application, kind of launchpad, which triggers several other react-based js files.
2. The mentioned ReferenceError is inside a function updateWindow() but the console never mentions this (and that's my problem).
PS: I'm using Eclipse tomcat on server-side
I think there's no straight forward solution to this problem. So, I'll post the method that worked for me with few additional points:
Problem: It doesn't gives a nice error trace like standard Java application, probably because it mixes with JavaScript code.
At every line of the error trace, line:column specifies the error line. I used this as a reference and started manual debugging from where my application launches i.e. Server.java and look where I defined the createChart() in the JS file and drill-down until I found the referenced variable.
In case of ReactJS' error (an error after resolving reference issue), I debugged it with normal react.js (not minified version react.min.js) so that it shows me exact line of error. Minified version is cluttered and is useless while debugging.
PS: If someone has better answer I'll edit this in future.
I'm testing out a website that runs fine on Firefox (Win/Mac), Chrome (Win/Mac) and Safari. I'm having difficulty with Internet Explorer unfortunately. I get the following error message:
SCRIPT65535: Unexpected call to method or property access.
raphael-min.js, line 8 character 64961
I've taken a look at the debug output which looks like just takes me to a part of the Raphel library:
c=a.getScreenCTM()||a.createSVGMatrix()
I've searched for this error message online, but I don't understand what solution is relevant to this case as I've no idea what is causing the problem. I am also using the jQuery library. Are there any tests that I can do that can give me more information about the source of the problem?
I just found how to patch this, in order to keep the compressed version of Raphael.
Replace (don't forget the coma):
c=a.getScreenCTM()||a.createSVGMatrix(),
By that (dont't forget the end space):
c;try{c=a.getScreenCTM()||a.createSVGMatrix()}catch(e){c=a.createSVGMatrix()};var
Works fine ! :)
Means :
c; : declaration of variable c, and stop the first instruction.
try{c=a.getScreenCTM()||a.createSVGMatrix()}catch(e){c=a.createSVGMatrix()}; : our instruction, surrounded by a try/catch, to avoid IE error
var + a space : (don't forget the space!) allow us to continue to declare variable
I found out that it's an issue with compression (of the js file). I had the exact same issue and I had been searching for a solution. Guess what? I tried it with the uncompressed Raphael file and voila! No more issues. Compressed file needs a tweak, it seems.
I'm having problems with getting decent JavaScript error invormation in a Production environment.
When I'm developing I can just attach a debugger and (usually) fix the problem.
When I get the same error in a production environment however at best I see is an error report that looks like this:
Error: Object doesn't support this property or method
Url: SomePage
Line: 42
Char: 13
Which doesn't help me very much - I can't see the rendered page and so I have no idea what line 42 looks like.
Is there any way for me to log the entire rendered page contents whenever an error like this occurs? (So line 42 of the output is the line where the error occured)
While I'm at it, are there any other techniques that I can use to help with getting useful error information from JavaScript (without need to break into the debugger) - failing that is there any way that I can structure my JavaScript slightly differently to help getting decent debug information?
I'm predominantly interested in IE - this is the browser that tends to cause me most problems.
I don't think you'll be able to get the exact original HTML source of the page back in all pages and all browsers.
Regarding debugging, you could use a logging library such as log4javascript (disclaimer: I wrote it) and intersperse logging calls in your code. log4javascript enables you to send logging messages back to the server via Ajax.
Unfortunately, IE has by default the most utterly useless error reporting. The script and line number reported in the error are essentially guaranteed to be absolutely wrong. You can, however, install the IE developer tool bar (for IE7 and older, it's built into IE8) from Microsoft, which can help track down the error source.