开发者

Jquery not working in IE

开发者 https://www.devze.com 2022-12-09 05:28 出处:网络
could some one look as this Jquery code, I am trying to make a Ajax plugin <script type=\"text/javascript\"&g开发者_高级运维t;

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

精彩评论

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