Skip to content

Commit

Permalink
jQuery.print: add support for NaN; remove $.isFunction ($.isFunction(…
Browse files Browse the repository at this point in the history
…jQuery) is false); use .nodeType to detect DOM elements (no HTMLElement in IE6)
  • Loading branch information
tmm1 committed May 12, 2008
1 parent 4e47ead commit 4627630
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/jquery.print.js
Expand Up @@ -94,19 +94,23 @@
else if (typeof obj == 'boolean')
return obj.toString()

else if (!obj && typeof obj == 'number')
return 'NaN'

else if (!obj)
return "null"

else if (typeof obj == 'string')
return print_string(obj, opts)

else if ($.isFunction(obj))
return obj.toString().match(/^([^\{]*)\s{/)[1]
else if (typeof obj == 'function' || obj instanceof Function)
return (m = obj.toString().match(/^([^\{]*?)\s*{/)) ? m[1].replace(' (','(') : 'function()'

else if (obj instanceof Array)
return print_array(obj, opts)

else if (obj instanceof HTMLElement)
// no HTMLElement in IE6
else if (obj.nodeType)
return print_element(obj)

else if (obj instanceof jQuery)
Expand Down

0 comments on commit 4627630

Please sign in to comment.