Works in JavaScript mode from Processing but no from the exported directory

edited November 2013 in JavaScript Mode

My sketches (I've tried several) work fine in JavaScript mode run from the Processing environment. But when I export for he web and then open the index.html file, the Processing area on the page is just blank. I get the same behavior on a Mac and a PC. Seems like I must just be missing some step or doing something wrong.

Answers

  • edited November 2013

    Are you just opening the index.html file itself, or are you hosting it on a local webserver?

    On OSX, using terminal, navigate to the directory where the index.html file is hosted and type python -m SimpleHTTPServer and navigate to localhost:8000. Does it work then?

  • It depends on the browser: some of them doesn't allow JavaScript to be run on a page opened from the filesystem, for security reasons.

    As said, you should open them from http://localhost with a Web server running locally.

  • edited November 2013

    Firefox and its derivatives allow it!
    For others like Opera & Chromium and derivatives, we gotta dive into some advanced configuration for it! :-j

  • Ah. Thanks. I was just trying to open the index.html as I had done with the Applet versions in the past. All is well.

Sign In or Register to comment.