Home > front end >  How the real-time data to the next JSP page
How the real-time data to the next JSP page

Time:09-26


<script>
//get input box
Var $kw=$(" # keywords ");


//add keys raise events
$kw. Keyup (function () {
In the input box input//
Var $value=(https://bbs.csdn.net/topics/$kw.val);



})

CodePudding user response:

Page without refreshing the input value is set to global variables on the window above, refresh with the browser cache localStorage, from one page to the next page is not the real time, real time is two pages at the same time, A change B pages will change

CodePudding user response:

I want to real-time access to the value of the text box, the text frame's value is not to jump to the next page search database, again to find the data back to the

CodePudding user response:

This box the ajax articles of value directly to the API, API database query return value, web shows not line?

CodePudding user response:

I will only the surface of ajax, API also do not come out, I now want to send the client input content in real time to server queries

CodePudding user response:

Var $kw=$(" # keywords ");

//add keys raise events
$kw. Keyup (function () {
In the input box input//
Var $value=(https://bbs.csdn.net/topics/$kw.val);
$. Ajax ({
Type: "get",//data sent (post or get)
Url: "claddbl. JSP,//to be sent back office address
Data: {wd: $value},
})



So I calculate a value in the past?

CodePudding user response:

Write API url address is xx. JSP type into method: 'post'
 
$. Ajax ({
Method: "post",//data sent (post or get)
DataType: 'json,
Url: "claddbl. JSP,//to be sent back office address
Data: {
Wd: $value
},
Success: the function (res) {
The console. The log (res)
},
Error: function (error) {
Alert (' error ')
}
})

CodePudding user response:

Ok, thank you, I really want to in the text box input values, you can go to fuzzy database query, and then in front of the back to the single page to choose from, that this approach can work

CodePudding user response:

Success: the function (res) {
The console. The log (res)
},

If the API successfully returns data will be displayed here

How to display the page is how to write it

CodePudding user response:

Ok, thank you
  • Related