Adding Selector Support to jQuery.get() to get page fragments
Just wrote a little plugin whilst working on a project because I keep finding myself using this functionality and having to write a handler in my application code. This plugin can be dropped in, just like jQuery Animate Enhanced and weighs in at less than 1KB, and it will enable you to quickly grab a partial or fragment of the AJAX endpoint.
Here’s some dummy code:
There’s not really much more I can say about this. Its unobtrusive, light weight and will simply hand over to the native jQuery.get() method if no selector is supplied.
Further Resources
Tweet Follow @benpbarnettComments are closed.
Google Chrome is causing troubles with documents that contain a doctype. If the page requested contains , Google Chrome throws an error “INVALID_STATE_ERR: DOM Exception 11″.
That’s a security error usually triggered when grabbing a file locally. Make sure you’re running from a webserver and not on a file:// type URL. Let me know if you’re still having issues.