Skip to content

Instantly share code, notes, and snippets.

@cowboy
cowboy / jquery.ba-istype.js
Created January 18, 2010 14:28
The Miller Device - jQuery Plugin
// based on http://zaa.ch/1q
$.isType = function( obj, type ) {
var opt = Object.prototype.toString,
result = opt.call( obj ).slice( 8, -1 ).toLowerCase();
if ( type === 'null' || type === 'undefined' ) {
type = type === 'null' ? opt.call( null ) : opt.call( undefined );
type = type.slice( 8, -1 ).toLowerCase();
}
<html>
<head>
<script type="text/javascript" src="LAB.js"></script>
<script type="text/javascript">
var _queue = ["script1.js",null], $L = $LAB;
</script>
...
</head>
<body>