When ajax asynchronously requests data on a chat page, no matter whether data is returned or not, ios will flash, but android will not flash. what is the problem and how to solve it? {code ...} when ajax asynchronously requests data on a chat page, no matter whether data is returned or not, ios will flash, but android will not flash. what is the problem and how to solve it?
$ (Document ). ready (function () {$ ('. loading_box '). attr ('style', 'display: none'); ajaxform (); window. setInterval ("ajaxform ()", 3000) ;}); function ajaxform () {var id = $ (". main_box ul li: last-child "). find ('. delete_btn '). attr ('field'); // alert (id); $. post ("{: U ('app/Friends/ajaxform ')}", {"openid": openid, "id": id}, function (data) {if (data) {var str = ""; console. log (data); $. each (data, function (index, array) {if (array ['openid'] = openid) {if (array ['type'] = 0) {// normal text or image str =''+ Array ['uname'] +'
'+ Array ['Time'] +'
'+ Array ['content'] +'
Delete
';} Else {// My dashboard str =''+ Array ['uname'] +'
'+ Array ['Time'] +'
Duplicate Kingdom screen '+ arr [array ['type'] +' second'+ Array ['content']; if (array ['IMG']! = "") {Str + = '';} str + ='
Delete
';}} Else {if (array ['type'] = 0) {// normal text or image str =' '+ Array ['uname'] +'
'+ Array ['Time'] +'
'+ Array ["content"] +'
'; If (isadmin) {str + ='Delete
Pull Black
';} Str + =' ';} Else {// others' screen str =' '+ Array ['uname'] +'
'+ Array ['Time'] +'
Duplicate Kingdom screen '+ arr [array ['type'] +' second'+ Array ['content']; if (array ['IMG']! = "") {Str + = '';} str + ='
'; If (isadmin) {str + ='Delete
Pull Black
';} Str + =' '; }}$ (". Main_box ul "). append (str); $ ('. main_box '). scrollTop ($ ('. main_box ') [0]. scrollHeight );});}});}
Reply content:
When ajax asynchronously requests data on a chat page, no matter whether data is returned or not, ios will flash, but android will not flash. what is the problem and how to solve it?
$ (Document ). ready (function () {$ ('. loading_box '). attr ('style', 'display: none'); ajaxform (); window. setInterval ("ajaxform ()", 3000) ;}); function ajaxform () {var id = $ (". main_box ul li: last-child "). find ('. delete_btn '). attr ('field'); // alert (id); $. post ("{: U ('app/Friends/ajaxform ')}", {"openid": openid, "id": id}, function (data) {if (data) {var str = ""; console. log (data); $. each (data, function (index, array) {if (array ['openid'] = openid) {if (array ['type'] = 0) {// normal text or image str =''+ Array ['uname'] +'
'+ Array ['Time'] +'
'+ Array ['content'] +'
Delete
';} Else {// My dashboard str =''+ Array ['uname'] +'
'+ Array ['Time'] +'
Duplicate Kingdom screen '+ arr [array ['type'] +' second'+ Array ['content']; if (array ['IMG']! = "") {Str + = '';} str + ='
Delete
';}} Else {if (array ['type'] = 0) {// normal text or image str =' '+ Array ['uname'] +'
'+ Array ['Time'] +'
'+ Array ["content"] +'
'; If (isadmin) {str + ='Delete
Pull Black
';} Str + =' ';} Else {// others' screen str =' '+ Array ['uname'] +'
'+ Array ['Time'] +'
Duplicate Kingdom screen '+ arr [array ['type'] +' second'+ Array ['content']; if (array ['IMG']! = "") {Str + = '';} str + ='
'; If (isadmin) {str + ='Delete
Pull Black
';} Str + =' '; }}$ (". Main_box ul "). append (str); $ ('. main_box '). scrollTop ($ ('. main_box ') [0]. scrollHeight );});}});}
Flashing is to refresh the page and check whether there is code for re-rendering the page.