开发者

Jquery not working in IE

could some one look as this Jquery code, I am trying to make a Ajax plugin

<script type="text/javascript"&g开发者_高级运维t;
$(document).ready(function() {
 $('#letter-a a').click(function() {
  $('#dictionary').load('a.php') ;
  return false;
  });
});

Basically it wont work in IE , In FF and Safari it works perfect.


Just a wild guess, because not enough info is given. IE is in general more strict with the content type of Ajax loaded html. Make sure that a.php is actually returning text/html.

Also, if you are building a framework, it would be better to use the more powerful $.ajax method. Among others it allows you to register a callback in case of an error. This could be handy in your situation.


1, I guess this is a problem of loading the same DIVs recursively into itself? You load into #dictionary .. but the outer div of the returned code is a #dictionary, Check that out

2, I would also try to put your link as a href="javascript:void(0)" and remove the return false..

3, Maybe it's also that a.php returns a full page with the <html> tag, a.php only need to return a portion of HTML

4, Check for HTML/XHTML validity, it's surprising how it can affect the behavior

Thank

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜