修改了review视图中 在IE里Json.length方法失效的问题

This commit is contained in:
Li Jianxuan 2011-11-09 07:56:33 +00:00
parent 1768ed5889
commit 3fe036d10b
1 changed files with 28 additions and 19 deletions

View File

@ -145,20 +145,29 @@
<script> <script>
loadmdcomment(1); loadmdcomment(1);
function loadmdcomment(page){var url="/review/allreview/uuid/<?php echo $md['uuid'];?>/";if(page!=''){url+='page/'+page;} function loadmdcomment(page){
$.ajax({type:"POST",url:url,data:'',success:function(html){$('#allcomments').html(html);},beforeSend:function(){$('#allcomments').html('<img src="/images/loading.gif" />正在加载...');}});} var url="/review/allreview/uuid/<?php echo $md['uuid'];?>/";
if(page!=''){url+='page/'+page;}
$.ajax({
'type':"POST",
'url':url,
'data':'',
'success':function(html){$('#allcomments').html(html);},
'beforeSend':function(){$('#allcomments').html('<img src="/images/loading.gif" />正在加载...');}
});
}
function checkfiles(rid){ function checkfiles(rid){
$.ajax({ $.ajax({
type:"POST", 'type':"POST",
url:"/review/attlist/id/"+rid, 'url':"/review/attlist/id/"+rid,
data:'', 'data':'',
success:function(html){ 'success':function(html){
$('#filelist_'+rid).html(html); $('#filelist_'+rid).html(html);
}, },
beforeSend:function(){ 'beforeSend':function(){
$('#filelist_'+rid).html('<img src="/images/11887177066.gif" />正在加载...'); $('#filelist_'+rid).html('<img src="/images/11887177066.gif" />正在加载...');
}, }
}); });
} }
@ -189,16 +198,16 @@ $(document).ready(function() {
} }
var date = $('#postcomment').serialize(); var date = $('#postcomment').serialize();
$.ajax({ $.ajax({
type:"POST", 'type':"POST",
url:url, 'url':url,
data:date, 'data':date,
success:function(html){ 'success':function(html){
$('#infobox').html(html); $('#infobox').html(html);
$('#save').html('存草稿'); $('#save').html('存草稿');
setTimeout("$('#save').removeAttr('disabled');$('.box').remove();",3000); setTimeout("$('#save').removeAttr('disabled');$('.box').remove();",3000);
loadmdcomment(1); loadmdcomment(1);
}, },
beforeSend:function(){ 'beforeSend':function(){
$('#save').attr('disabled','disabled'); $('#save').attr('disabled','disabled');
$('#save').html('<img src="/images/11887177066.gif" />正在保存...'); $('#save').html('<img src="/images/11887177066.gif" />正在保存...');
} }
@ -251,7 +260,7 @@ $(document).ready(function() {
} }
$.getJSON("/upload/getatts/id/<?php echo $this->review['id'];?>", function(data) { $.getJSON("/upload/getatts/id/<?php echo $this->review['id'];?>", function(data) {
if(data.length>0) if(data)
{ {
$.each(data, function(key, val) { $.each(data, function(key, val) {
$('<li/>', { $('<li/>', {