Tag:Return data

  • Analysis of the sequence of returned data in Ajax request


    This paper analyzes the order of the returned data of Ajax request. For your reference, the details are as follows: After Ajax requests a URL, the array is in the following format after PHP back-end processing: Copy codeThe code is as follows: $a = array( ‘-1’=> 10 ,’-3′ => 2, ‘0’ => ‘5’ ,’-2′ => […]

  • Discuss in detail the method of Ajax returning data successfully but entering error


    I checked a lot on the internet, some said that it would be better to remove dataType:”json”, but I didn’t. Later, I found out that I was cross-domain. I’ll just add these lines in the background. PrintWriter out = response.getWriter(); response.setHeader(“Access-Control-Allow-Origin”, “*”); response.setHeader(“Access-Control-Allow-Methods”, “POST, GET, OPTIONS, DELETE”); response.setHeader(“Access-Control-Max-Age”, “3600”); My JS function submits(){ $.ajax({ type:”post”, […]