Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the application of ajax's json value transfer method in jsp pages?

Shulou Source: shulou.com Published: 2022-06-03 07:44:20 11月15日 Update

This article is to share with you about the application of ajax json value transfer in jsp pages, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it with the editor.

Jsp page:

The code is as follows:

$(document) .ready (function () {

SetInterval (function myTimer ()

{

/ / alert ('a')

GetViews ()

}, 1000)

});

/ / play

Function getViews () {

$.ajax ({

'url': "${pageContext.request.contextPath} / video/getVideos.action?r=" + Math.random () + "& open=1"

'data':''

'dataType': 'json'

'type': 'get'

'error': function (data) {

Alert ("error")

Return false

}

'success': function (data) {

If (null! = data & &'! = data) {

/ / alert (data.updateFlag)

If (data.updateFlag==0) {/ / if data.updateFlag=0 does not refresh

/ / alert ("data.updateFlag=0")

}

Else {

If (data.videoIds! = null & & data.videoIds! = "") {

Var listIds=data.videoIds

Var iTunes 0

For (; I)

Tags: Page code method method application different background more knowledge article practical ninth house key function that is work meeting location article server read it. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Redmi Apple Xiaomi OPPO Reno