New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in web worker using importScripts(defiant.min.js) #83
Comments
Hi @kskoeldMW, Kind regards <script src="defiant.min.js"></script>
<script>
var obj = {
"car": [
{"id": 10, "color": "silver", "name": "Volvo"},
{"id": 11, "color": "red", "name": "Saab"},
{"id": 12, "color": "red", "name": "Peugeot"},
{"id": 13, "color": "yellow", "name": "Porsche"}
],
"bike": [
{"id": 20, "color": "black", "name": "Cannondale"},
{"id": 21, "color": "red", "name": "Shimano"}
]
};
Defiant.getSnapshot(obj, function(snapshot) {
var found = JSON.search(snapshot, '//car');
console.log(found);
});
</script> |
Hi @hbi99 |
No...you can not access Defiant from within a web worker. I'd recommend that you look into the types of objects / scripts you can access into a web worker...defiant is not on of them. |
Ok thanks - too bad, since I really like the ease-of-use and speed of defiant. |
I wonder if you should familiarise more with web workers...messaging to and from a ww-thread is limited. Anywho...good luck |
Yes, thats exactly why doing that would not be a wise decision :) |
I'm trying to use defiant.js in a web worker, since I'm doing heavy computation in addition to the JSON.search.
However I keep getting a
I created a simple example using part of the demo code.
Archive.zip
The text was updated successfully, but these errors were encountered: