[jQuery] Event does not always bind to object
Hi,
I have a pretty strange problem with one of my scripts. I am working on
a little CRM and the customer overview page has six blocks looking
something like this:
<div id="general"><h1>the title</h1>
<a href="#" id="general_opener"><img src='openup_small.png' /></a>
<div class="block">familiy name<br />
first name ....</div>
</div>
When a user clicks on the image/link the following script runs:
$(document).ready(function(){
$("a#general_opener").click(function(){
if ( $("div#general div.block").is(":hidden") ) {
$("div#general div.block").slideDown("slow");
}
else {
$("div#general div.block").slideUp("slow");
}
return false;
});
... ( For each of the six blocks I have one $("a#something_opener") )
});
And now the strange part. The whole thing works for almost all customers
except for about 5%. And it is based on the customer I open up. With
those 5% only the first 3 blocks work and not the last three ones. With
the last three ones it just jumps to the top again. When I look in the
JavaScript Console (Firefox) I get the following messages:
once
-----------
Warning: variable h hides argument
Source File: http://URL/js/jquery.js
Line: 14, Column: 101
Source Code:
or==Function){f=o;o=null}if(o!=null){o=$.param(o);t="POST"}var
self=this;$.xml(t,a,o,function(h){var
h=h.responseText;self.html(h).find("script").each(function(){try{eval(this.text||this.textContent||this.innerHTML)}catch(e){}});if(f)f(h)});return
this};
three times
------------
Warning: reference to undefined property ret[0]
Source File: http://URL/js/jquery.js
Line: 14
I looked around in the DOM Inspector (under JavaScript Object) as well
and I found out that the events for those three blocks are not bound to
the object (e.g a#general_opener).
But I have no idea why this could happen. Because the only thing that
are changing from a customer to the other are the things inside a <div
class="block">
Does anyone have an idea or a hint what I could check?
Thanks
Raffael
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/