How to Make Client Side Data Available Server Side?
That would be pretty useful, right? Right now it’s very common to User Agent “sniff” when you want to make a server-side decision about what to give the client. But UA sniffing has always...
That would be pretty useful, right? Right now it’s very common to User Agent “sniff” when you want to make a server-side decision about what to give the client. But UA sniffing has always...
The issue is 1) custom fonts are awesome and we want to use them 2) custom fonts slow down our pages by being large additional resources. Dealing with this has been in the air...
This is like a replacement for PHP’s SCRIPT_NAME with JavaScript. location.href.split(‘/’).pop(); For example with this URL: http://css-tricks.com/examples/ScriptName/index.php This code: document.write( location.href.split(‘/’).pop() ); Would write to the page: “index.php” Reference URL
JavaScript is supported by the Camino, Firefox, Google Chrome, iCab, Internet Explorer, Konqueror, Netscape, OmniWeb, Opera, Safari and SeaMonkey Web browsers, and so almost everyone can use it. However, some people worry that JavaScript...
<script type=”text/javascript”> document.write(“Welcome, you have Javascript on.”) </script> <noscript>JavaScript is off. Please enable to view full site.</noscript>
It doesn’t have all the fancy callbacks and options, but hey, it makes things draggable (and with a specified handle optionally). (function($) { $.fn.drags = function(opt) { opt = $.extend({handle:””,cursor:”move”}, opt); if(opt.handle === “”)...
I was playing with my new Nexus 7 (I really wanted to own a real Android device) and I noticed a neat little effect in the Google+ app that comes with it. As you...
/** * Gets or sets cookies * @param name * @param value (null to delete or undefined to get) * @param options (domain, expire (in days)) * @return value or true */ _.cookie =...
function doSomething() { /* This code by Subramanyam Inkollu */ var i = 0; // counter to be used later; } Comments in JavaScript can be between /* */ markings (useful for multiple line...
<textarea rows=”10″ cols=”50″ onclick=”this.focus();this.select()” readonly=”readonly”> example text </textarea>
var country_list = [“Afghanistan”,”Albania”,”Algeria”,”Andorra”,”Angola”,”Anguilla”,”Antigua & Barbuda”,”Argentina”,”Armenia”,”Aruba”,”Australia”,”Austria”,”Azerbaijan”,”Bahamas”,”Bahrain”,”Bangladesh”,”Barbados”,”Belarus”,”Belgium”,”Belize”,”Benin”,”Bermuda”,”Bhutan”,”Bolivia”,”Bosnia & Herzegovina”,”Botswana”,”Brazil”,”British Virgin Islands”,”Brunei”,”Bulgaria”,”Burkina Faso”,”Burundi”,”Cambodia”,”Cameroon”,”Cape Verde”,”Cayman Islands”,”Chad”,”Chile”,”China”,”Colombia”,”Congo”,”Cook Islands”,”Costa Rica”,”Cote D Ivoire”,”Croatia”,”Cruise Ship”,”Cuba”,”Cyprus”,”Czech Republic”,”Denmark”,”Djibouti”,”Dominica”,”Dominican Republic”,”Ecuador”,”Egypt”,”El Salvador”,”Equatorial Guinea”,”Estonia”,”Ethiopia”,”Falkland Islands”,”Faroe Islands”,”Fiji”,”Finland”,”France”,”French Polynesia”,”French West Indies”,”Gabon”,”Gambia”,”Georgia”,”Germany”,”Ghana”,”Gibraltar”,”Greece”,”Greenland”,”Grenada”,”Guam”,”Guatemala”,”Guernsey”,”Guinea”,”Guinea Bissau”,”Guyana”,”Haiti”,”Honduras”,”Hong Kong”,”Hungary”,”Iceland”,”India”,”Indonesia”,”Iran”,”Iraq”,”Ireland”,”Isle of Man”,”Israel”,”Italy”,”Jamaica”,”Japan”,”Jersey”,”Jordan”,”Kazakhstan”,”Kenya”,”Kuwait”,”Kyrgyz Republic”,”Laos”,”Latvia”,”Lebanon”,”Lesotho”,”Liberia”,”Libya”,”Liechtenstein”,”Lithuania”,”Luxembourg”,”Macau”,”Macedonia”,”Madagascar”,”Malawi”,”Malaysia”,”Maldives”,”Mali”,”Malta”,”Mauritania”,”Mauritius”,”Mexico”,”Moldova”,”Monaco”,”Mongolia”,”Montenegro”,”Montserrat”,”Morocco”,”Mozambique”,”Namibia”,”Nepal”,”Netherlands”,”Netherlands Antilles”,”New Caledonia”,”New...
Automatic copying to clipboard may be dangerous, therefore most browsers (except IE) make it very difficult. Personally, I use the following simple trick: function copyToClipboard (text) { window.prompt (“Copy to clipboard: Ctrl+C, Enter”, text);...
The use of scriptlets (those <% %> things) in JSP is indeed highly discouraged since the birth of taglibs (like JSTL) and EL (Expression Language, those ${} things) over a decade ago. The major disadvantages of scriptlets are: Reusability: you can’t reuse scriptlets. Replaceability: you can’t make...
You don’t need jQuery for that purpose. You can use the pure JavaScript: function getParameterByName(name) { name = name.replace(/[\[]/, “\\\[“).replace(/[\]]/, “\\\]”); var regexS = “[\\?&]” + name + “=([^&#]*)”; var regex = new RegExp(regexS);...
Now that we have a pair of coordinates, we can use them with the Google Maps API (Application Programming Interface). The API we’ll use is called staticmap. This is one of the easier Google mapping...
Make a CSS sprite image, with the top half and the bottom half being the two images you want to animate between. The jQuery adds a <span> tag, and adds the bottom half of the...
An ever growing amount of data is being made freely available by popular web services like flickr, twitter, the guardian, and many more. We’ve collected a list of great examples of how such data...