Get the App
SLTechnology News&Howtos  ›  Development  › 

A case study on the Application of JQuery Foundation

Shulou Source: shulou.com Published: 2022-06-01 07:36:20 09月17日 Update

This article mainly introduces "JQuery basic application case analysis". In daily operation, I believe that many people have doubts about the problem of JQuery basic application case analysis. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "JQuery basic application case analysis". Next, please follow the editor to study!

Recently, when I was learning HTML5 and jquery to do a small website, I encountered two problems:

1. Foreground and background data transfer I use the jquery ajax framework, the transmission method uses the json,js code as follows:

[code= "js"]

$('input [name = submit]'). Click (function () {

Var userInfo= "userName=" + $('input [name = userName]'). FieldValue () + "& password=" + $('input [name = password]'). Val (); / / .fieldValue () and .val () can both get the value

Var options= {

Url:''

Type:'POST'

DataType:'json'

Data:userInfo

Success: loginResponse

}

$.ajax (options)

})

Function loginResponse (result) {

Var loginRsl=eval (result)

If (loginRsl.loginResult== "login successful") {

_ window.location= "search.html"

} else {

Alert (loginRsl.loginResult)

}

}

[/ code]

The transmission has been successful, but how can the page jump be realized? For example, I hope to jump to my home page after the success of login, how to achieve this? In normal action, it is done through mapping.findFarword (). After checking the Internet, I realized the jump through _ window.location= "search.html"; but the problem arises again. At this time, I want to display the data loginRsl.loginResult sent back from the background on the search page. This seems to be impossible to get, and I can only read this value on the login.html page.

2.html5 is a static language, I now need to dynamically implement the screen, the most commonly used, like jsp, I need a for loop to dynamically generate a table based on the number of records returned in the background. How to implement this? you can't write java code in html.

At this point, the study of "JQuery basic application case analysis" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Basics examples case analysis analysis learning success problems pages transmission code dynamic background data more website help practical ordinary next two Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Information NVidia Apple Redmi