Update: disableTestSelect
Introduction ¶
Received a kind comment from dehneg the other day, he pointed out the disableTextSelect plugin has no way of enabling the text select after it’s been disabled, pretty large thing for me to neglact. So here is an updated version with enableTextSelect.
Requirements ¶
- jQuery - Core that the plugin runs with
Compatibility ¶
So far the plugin has been tested in windows using the following browsers.
- IE 6, 7
- FF 1.5, 2, 3
- Opera 9
- Safari 3
Usage ¶
HTML
1 2 3 | <p class="disableSelection"> this text can't be selected. </p> |
Javascript
1 2 3 | $(function() { $('.disableSelection').disableTextSelect(); // and enableTextSelect() to re-enable it again }); |
Downloads ¶
jquery.disable.text.select.jsjquery-disable.text.select.example.htm
jquery.disable.text.select.pack.js
jQuery serverCookieJar
Introduction ¶
After work on the jQuery plugin cookieJar it was pointed out that cookie data is sent with every request and that cookies have a limit of 4KB, this got me thinking. What about storing this information on the server.
This is done by making a request to the server when the page first loads with a request for the data. Then only any changes are sent to the server when something changes. This adds the size of this data for the page to the down traffic (much faster than the up traffic) occurring just once per page, rather than the up traffic for every request on a page.
Requirements ¶
Requirements to use this code
Compatibility ¶
So far the plugin has been tested in windows using the following browsers.
- IE 6, 7
- FF 1.5, 2, 3
- Opera 9
- Safari 3
Usage ¶
This plugin is designed as an alternative to cookieJar. See it’s doc’s and usage examples
Note: This plugin uses async:false option on ajax. This means when a serverCookieJar object is created for the cookieJar it makes a request to the server for that cookieJar, the browser will pause until the cookieJar has been retrieved from the server, the larger the serverCookieJar or the slower the server the longer this will take.
Example ¶
jquery.servercookiejar.example.html
Downloads ¶
Here are the downloads
jquery.servercookiejar.js (7.2KB)jquery.servercookiejar.pack.js (2.4KB)
jquery.servercookiejar.php (0.7KB)
jQuery cookieJar bug fix
Bug Fix
Found a little bug in the cookieJar script I recently released.
If you try to create a second cookieJar it over writes the previous cookieJar object.
The fix returns a new instance to a cookieJar as was intended
Sorry about the bug
Downloads
jquery.cookiejar.js (6.54 KB)jquery.cookiejar.pack.js (2.06 KB)