Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A case study on the Application of JQuery Foundation

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report