jquery取得值,ios取得不到,而android可以
<code><script type="text/javascript"> var pageurl="{:U('App/Friends/page')}"; var tpl="{$tpl}App/Friends/Public/"; var headimgurl="{$person['headimgurl']}"; var openid="{$person['openid']}"; var uname="{$person['uname']}"; var classid="{$person['classid']}"; var isadmin="{$person['isadmin']}"; var isblack="{$person['isblack']}"; var arr=[0,10,20,30,60]; var contenturl="{:U('App/Friends/getcontent')}"; $(document).ready(function(){ $('.loading_box').attr('style','display:none'); ajaxform(); setInterval("ajaxform()",3000); }); </script> function ajaxform(){ var id=$(".main_box ul li:last-child").find('.delete_btn').attr('field');alert(id);alert(isadmin); $.ajax({ type:'POST', url:"{:U('App/Friends/ajaxform')}", data:{"openid":openid,"id":id}, dataType:"json", global:false, success:function(data){ $.each(data[1],function(e,a){ isblack=a; }); } });</code>
}
jquery取得值,ios取得不到,而android可以
<code><script type="text/javascript"> var pageurl="{:U('App/Friends/page')}"; var tpl="{$tpl}App/Friends/Public/"; var headimgurl="{$person['headimgurl']}"; var openid="{$person['openid']}"; var uname="{$person['uname']}"; var classid="{$person['classid']}"; var isadmin="{$person['isadmin']}"; var isblack="{$person['isblack']}"; var arr=[0,10,20,30,60]; var contenturl="{:U('App/Friends/getcontent')}"; $(document).ready(function(){ $('.loading_box').attr('style','display:none'); ajaxform(); setInterval("ajaxform()",3000); }); </script> function ajaxform(){ var id=$(".main_box ul li:last-child").find('.delete_btn').attr('field');alert(id);alert(isadmin); $.ajax({ type:'POST', url:"{:U('App/Friends/ajaxform')}", data:{"openid":openid,"id":id}, dataType:"json", global:false, success:function(data){ $.each(data[1],function(e,a){ isblack=a; }); } });</code>
}
你先註解其它的,頁面進入只運行這行,我剛用7.2版本iphone的測試,可以出來的。
<code>var id=$(".main_box ul li:last-child").find('.delete_btn').attr('field');alert(id);</code>
聲明function放在ready函數裡。