The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

Using jQuery from an HTML5 Web Worker

jQuery is one of the most useful frameworks out there for web development. And while most of jQuery is very much about working with the browser DOM there is also another side to it that makes doing networking real easy and that is all based around the $.ajax() and related, like the $.getJSON(), functions. Now HTML5 contains a real useful part in Web Workers for doing work that should not block the background thread. And using the XMLHttpRequest for network IO is fine in a Web Worker.

Unfortunately however working with the DOM is not ok in the Web Worker, which makes total sense, but as a result using jQuery, which has lots of DOM related code is not fine in a Web Worker. And that is a shame because using jQuery for just network IO would be much easier that the XMLHttpRequest and totally fine if it would load.

 

So removing the DOM code from jQuery should solve the problem right?

 

 

Enter the jQuery - No DOM Edition

 

It turns out Konstantin Pozin did just that with the jQuery - No DOM Edition Smile

 

You can find it here or download a test version here.

 

Enjoy!

 

TheProblemSolver
DotNetEvents

Published Tue, Apr 10 2012 10:57 by Maurice
Filed under: , ,

Comments

# re: Using jQuery from an HTML5 Web Worker@ Wednesday, April 11, 2012 7:33 AM

Its simple and comfortable way.

by Maxim