This is the most annoying and bizarre issue I've ever encountered with jQuery. It's ridiculously basic (one of those Murphy Law bugs)
I have a div (divDialog):
<div id="divDialog"> </div>
I call the dialog function:
$('#divDialog').dialog();
This gives me this error in firebug:
this.element[0].nodetitle is undefined
If I remove the div, the error will disappear. If I console only part of the selector, it shows the node in firebug and everything looks good. I am currently extending jquery in the following ways:
$.fn.isAfter = function(sel){ //returns true if element is after, else return false, for animations return this.prevAll(sel).length > 0; } $.fn.isBefore= function(sel){ //returns true if element is before, else return false, for animations return this.nextAll(sel).length > 0; } $.fn.exists = function(){ //returns true if element exists, false if not return this.length>0; } $.fn.btnClick = function(fn){ //check if the element is disabled before executing onclick $(this).click(function(){ if($(this).attr('disabled')!='disabled'){ fn(this); } }); return $(this); } $.fn.btnToggle = function(){ //toggle disable/enable if($(this).attr('disabled')=='disabled'){ $(this).removeAttr('disabled'); } else{ $(this).attr('disabled','disabled'); } return $(this); }
I also extend the prototype of the array:
Array.prototype.isArray = true; //this allows us to say if(variable.isArray) to detect arrays
Any ideas? It upsets me. Any help or guidance would be greatly appreciated.
source share