Agrawal, Ritesh schrieb:
> Hi Klaus,
> 
> I think i found the problem,,
> 
> It seems the problem is with "value" attribute...when I changed the value
> attribute to href ...everything seemed to worked fine...let me explain it in
> more detail..
> 
> Using PHP I was creating multiple divs...which had following structure
> 
> ///======= This code doesn't work ======
> In my JQuery I was using this
> $(div.record).click(function(){
>   $("div#content").load($(this).attr('value'));
> });
> 
> <div id="container">
>     <div class="record" value="some_url_over_here">Value 1</div>
>     <div class="record" value="another_url_over_here">Value 2</div>
> </div>
> 
> 
> The above code gives error..but if change the name of attribute from "value"
> to "href" or to any other..and make appropriate changes in the JQuery ..then
> everythings works fine...so this code works fine...
> 
> ///======= This code works ======
> In my JQuery I was using this
> $(div.record).click(function(){
>   $("div#content").load($(this).attr('href'));
> });
> 
> <div id="container">
>     <div class="record" href="some_url_over_here">Value 1</div>
>     <div class="record" href="another_url_over_here">Value 2</div>
> </div>
> 
> Note: I haven't tested on a static page...I am using lot of ajax stuff -
> thanks to JQuery for making it so simple...so I am not sure whether the
> problem is due to some ajax or is an inherent bug in JQuery
> 
> Regards,
> Ritesh

Just another example to me why sticking to standards is good and saves 
you trouble. If you'd use anchors or some other form of storing the data 
than custom (invalid) attributes, you wouldn't have run into this 
problem in the first place.


-- Klaus

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to