gitjhn / p5-vs-R

Processing vs Raphael experiment for HTML5 canvas using javascript.
1 stars 1 forks source link

Resolve local ajax cross origin issues in firefox by removing json load requirement #1

Closed ninjapanzer closed 9 years ago

ninjapanzer commented 9 years ago

PROBLEM

Cross origin is a pain, especially when using the file:// protocol. I venture that you have modified the security restrictions in your version of Firefox when working with loading local JSON because it binds up in a vanilla firefox install from my testing. That said we can solve this cross origin issue in Firefox but not Chrome because Chrome has a bug currently. All this can be run under a webserver like python -m SimpleHTTPServer as well for the non firefox peeps.

SOLUTION

Makes states data a script so it doesn't need to be ajaxed Removed ajax step from main-p and main-r and replaced them with just the image loader portions. Renamed to loadFlags

There is a cross origin image loading issue in chrome but this works in firefox without security modifications

gitjhn commented 9 years ago

Thanks Paul. @ninjapanzer