Processing.js FloatList doesn't work on web - javascript

My processing.js sketch uses FloatList and it works when I build it with Sublime. However, when I try to run it on a web page, the sketch doesn't load and I get Uncaught Processing.js: Unable to execute pjs sketch: ReferenceError: FloatList is not defined from the javascript console. Why is this happening and how can I fix it?
Any suggestions and help would be gratefully appreciated.

Well, the error says it all: Processing.js does not have a FloatList class. You can confirm this by checking out the Processing.js reference.
I'm not sure why Processing.js didn't implement the FloatList class. Maybe because JavaScript arrays are so different than Java arrays. That's just a guess though. Here is an open issue about this on Processing.js's GitHub page. Here is another issue that shows which classes have been implemented. FloatList is indeed not yet implemented.
In any case, you're going to have to modify your code to get rid of the FloatList class.
Of course, Processing.js is open source. So you could always add the FloatList class yourself! You might even be able to copy much of the source directly.

Related

ReferenceError: document is not defined (JavaScript in VS Code)

Im learning JS. Found a good video "JavaScript Programming - Full Course" and stucked at the 2nd part where I need to use DOM. I have the HTML document, in i refered to the JS file. Other stuff working well, but this:
let messageEL = document.getElementById("message-el")
Always get this error:
ReferenceError: document is not defined
I installed live server, and it works one time, than stops.
What can I do, to fix this? Do I need to download some extension?
Please tell me the solution as simple as u can Im at the beginning of the learning path.
This is the code and the error
In your screenshot, you're attempting to run the script using Node.js (the server-side JavaScript executable).
Since you say you're running live-server, you should be looking at your browser instead, not trying to run your code via Node.

Why isn't including this 'bigInt' script working? (p5.js web editor)

I'm following The Coding Train and learning about the p5.js library. In this particular exercise, I want to work with potentially massive integers, so I looked around and found peterolson/BigInteger.js.
I attempted to include this script in my project in the same way the p5.js library itself is included, and as suggested in BigInteger's readme:
<script src="http://peterolson.github.com/BigInteger.js/BigInteger.min.js"></script>
However, after doing so, I still get bigInt is not defined errors when I try to reference it from my script.js.
Could anyone help me understand what I'm missing? You can see my project in the p5.js web editor here!
Questions like these are best answered by looking at your developer tools. Check out the JavaScript console and the network log to see the error you're getting.
Basically, you can't reference files on GitHub the way you're trying to reference BigInteger.min.js. You either need to find a CDNS that hosts the file for you, or you need to upload it to your sketch and reference it via a relative url.

"SecurityError: The operation is insecure." when trying to include JS file

I have a remote HTTPS-server on which I published my website.
This site is being displayed in Chrome as it should, but in Firefox or IE it is not.
(Click image to enlarge)
I got a security error in my console. I have googled this problem, but still have no correct answer. Maybe someone here has encountered a problem like this. I'd be very appreciative if someone helped me to find out what's wrong.
The problem is not related to your vendor.js. It is auto-builded script and it contains all the code from the Vue components.
As #KevinB said, inside the generated file vendor.js your code probably deals with http://website.com link. So you gotta check out your Vue components on such links and change them to SSL-certificated.
Wish it helps.

Processing sketch does not work in Browser

I created a sketch in Processing and I would like to put it on a website using Processing.js. I created an html page to put the sketch in and tested it out, but all I see is white screen. The sketch doesn't work.
I've read through the Processing.js Quick Start and as far as I can tell, I've resolved any problems with my sketch and processing.js. My next thought was that there was something wrong with the way I wrote the HTML page, or maybe my browser, but when I tested it with a simpler sketch, that sketch worked just fine. So there has to be something wrong with the sketch itself, but I can't figure out what it is.
For reference, here is the link to where the sketch is supposed to be and the source code of my sketch.
Site
Code
Thanks for any help you can provide.
Edit: Here's the error recieved in the console:uncaught exception: Processing.js: Unable to load pjs sketch files: WarefareBeta1_3/WarefareBeta1_3.pde ==> Invalid XHR status 404
Use an absolute URL in your data-processing-sources (something like http://krotalov.net/NonJoomla/WarefareBeta1_3/WarefareBeta1_3.pde).
Because the file you mention
there now, WarefareBeta1_3/WarefareBeta1_3.pde does not seem to be on the server. Or at least not in that directory.

Problem porting WordPress Editor to a non-WP application

I like the look and feel of the WordPress editor (version 2.7), and I would like to use it in another web application that is written in ASP.NET. I've used TinyMCE before, and I've even extended it in the past. However, I can't seem to get the Wordpress configuration to work!
I've downloaded the entire WordPress package and taken the TinyMCE code (from the "js" folder) and put it in my web site. It ends up giving me an error on the following line of tiny_mce.js
return f.apply(s||this,Array.prototype.slice.call(arguments,2))
'undefined' is null or not an object.
Now, I've carefully made sure that the steps of execution are identical with the WordPress demonstration site that I've based this from.
I'm not a Javascript newbie (at all), but I can't seem to figure out why this is not working. Has anybody tried to do this before? What am I missing?
A demo of what I am talking about is here (username="admin", password="demo"). View the source, I have the three parts of Javascript that are (seemingly) required to power the editor.
Something of a stab in the dark, but I'm suspecting that there's a dependency on WP's prototype.js and you didn't bring that over with TinyMCE.
If you are able to determine which bit is undefined that might give you a clue. I tried looking at the demo with firebug, but tinymce.js was all one line, so I gave up trying to find that code.
Try putting in either some console.log() if you have firebug, or alert()s before that line, and try to see what f,s,this,arguments etc are when yu get the error, then do the same thing with a vanilla WP install and see the difference?
I suggest including the tiny_mce_src.js istead of the minified version, this way you can use firebug to debug and receive helpfull information.

Categories

Resources