This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function iCheck(func){ | |
if (!(navigator.userAgent.match(/iPhone/i)) || !(navigator.userAgent.match(/iPod/i)) || !(navigator.userAgent.match(/iPad/i))) { | |
func(navigator.userAgent); | |
} | |
} | |
// Usage | |
iCheck(function(agent){ | |
// You can use a case select statement to | |
// evaluate what actions you want to do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.numOnly = function() { | |
return this.each( function() { | |
// backspace(8), dot(.), tab(0) 0-9 | |
var c = [8, 0, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58]; | |
if ($(this).attr('type') === 'text') { | |
$(this).keypress( function(e) { | |
if (c.indexOf(e.which, c) == -1) { | |
e.preventDefault(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from Google. Is that evil? | |
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
NewerOlder