jQuery 加载导致 Opera 浏览器加载整个页面
这是我的页面中存在问题的部分:
<div id="notice_box" class="center">
<div id="notice_cont"></div>
<script>
function notice(more)
{
$('#notice_cont').load('notice.php?more_notice='+more);
}
</script>
</div>
<div id="notice_box_foot">
<img src="images/notice-box-bl.png" class="left">
<img src="images/notice-box-br.png" class="right">
</div>
</div>
它被这样调用:
<a style="margin-right:5px;" class="right" href="javascript:notice(3);"><img src="images/not-less.png" /></a>
该脚本应该用 notice.php
填充 #notice_cont
...而不是它填充整个页面...在除 Opera 之外的所有浏览器中都可以正常工作!也没有错误。
Here is the part of my page with the problem:
<div id="notice_box" class="center">
<div id="notice_cont"></div>
<script>
function notice(more)
{
$('#notice_cont').load('notice.php?more_notice='+more);
}
</script>
</div>
<div id="notice_box_foot">
<img src="images/notice-box-bl.png" class="left">
<img src="images/notice-box-br.png" class="right">
</div>
</div>
It gets called like this:
<a style="margin-right:5px;" class="right" href="javascript:notice(3);"><img src="images/not-less.png" /></a>
The script is supposed to fill #notice_cont
with notice.php
... rather it fills the whole page with it... works fine in all browsers except Opera! There are no errors either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议更改
标记:
以确保
标记本身的默认行为不会发生。
I would suggest changing that
<a>
tag:to make sure that the default behavior of the
<a>
tag itself does not happen.您是否尝试过验证notice.php的输出?由于您没有显示此标记,我只是在这里猜测,但我猜想该标记格式错误,因此 Opera 无法正确插入它。
Have you tried validating the output of notice.php? Since you haven't shown this markup I'm just guessing here, but I'd guess that the markup is malformed and Opera thus doesn't insert it correctly.