JavaScript Detector

My project requires JavaScript to copy text to the clipboard. What I'm looking for is a way to detect whether JavaScript is enabled.

Load the "catch errors" library and use it to try your JS block.

you can use this block:
untitled script pic

How do I do that?

Can't find it anywhere. Is it a custom block?

Never mind found it, thanks

Yes. Drag-n-drop the image onto the Snap! code editor.

Using the “Catch errors” library, that would be:

Still, I wonder why a ready-to-use untitled script pic 115 predicate is not in the “Getters and setters” library?

BTW I wrote a different kind of JavaScript detector some time ago, checking whether any JavaScript code was used within a custom block's implementation definition, or within any other custom block called (directly or indirectly) by the initial block.

I think the library predates the JS Function block.

This library requires JS to be already enabled...

That is: each of the functions currently within the library.
Wouldn't you agree this to be all the more reason for including a "JS-enabled" detector?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.