Home > Backend Development > PHP Tutorial > javascript - jquery gets value, ios and android get value problem

javascript - jquery gets value, ios and android get value problem

WBOY
Release: 2023-03-02 10:58:02
Original
1020 people have browsed it

jquery can get the value, ios can’t get it, but android can

<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>
Copy after login
Copy after login

}
javascript - jquery gets value, ios and android get value problem

Reply content:

jquery can get the value, ios can’t get it, but android can

<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>
Copy after login
Copy after login

}
javascript - jquery gets value, ios and android get value problem

You comment on other things first, and only run this line when entering the page. I just tested it on iPhone version 7.2, and it works.

<code>var id=$(".main_box ul li:last-child").find('.delete_btn').attr('field');alert(id);</code>
Copy after login

Declare the function in the ready function.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template