易截截图软件、单文件、免安装、纯绿色、仅160KB

href="javascript:void(0);"在IE6中将断异步请求

Html页
<a href="javascript:void(0);" ><img id="SubmitFeedback" src="/images/comment_btn.gif" /></a>
脚本
$(document).ready(function() {
alert("页面刷新");
$("#SubmitFeedback").bind("click", Test);
});
function Test() {
alert("调用Test");
$.getJSON("url", function() {
alert("调用callback");
});
return false; // 如果注释此行,IE6下将不能执行getJSON的callback
}
当a标签的href属性为"javascript:void(0);"时,IE6认为应该进行页面跳转,所以中断了异步请求的callback;
FireFox3.5在页面真正跳转时才中断异步请求,不存在callback不执行的问题。


相关文档:

史上最牛X最简洁的Javascript图片缩放代码

源码:
function resize(img, width, height) {
 (img.width > img.height)
 ? ((img.height = Math.min(height, width * img.height/img.width)) || (img.width = Math.min(width, img.width)))
 : ((img.width = Math.min(width, height * img.width/img.height)) || (img.height = Math.min(hei ......

Javascript函数大全 (个人函数收集)


/*
 -------------- 函数检索 --------------
 trim函数:                         trim() lTrim() rTrim()
 校验字符串是否为空:  &n ......

用Fleaphp、JavaScript实现分页下拉框

<script type="text/javascript">
function fnOnPageChanged(page) {
 var url = '<?=url('ShowFront','Search',$Request);?>' + '&page=' + page;
 //alert(url);
 document.location.href = url;
 
}
</script>
 <select id="selectPage" onChange="fnOnPageC ......

javascript字符串转换成日期[js常用]

function strToDate(){
var nowDate = new Date();
var oldDate = '2009-06-08';
var oldTime = '16:00';
var year = oldDate.substr(0,4);
var month = oldDate.substr(5,2);
var day = oldDate.substr(8,2);
var temDate = month+'/'+day+'/ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号