How does php js pass values on different pages? Is there a simple method that js does not need to parse the received string?
Reply to discussion (solution)
Php cannot actively send data to js
So you should clarify your ideas first.
Php cannot actively send data to js
So you should clarify your ideas first.
What does it mean? On the js page, I need to get a value generated by php.
Js? Ask for php? Face ,? Php? ??.
Http://www.w3school.com.cn/jquery/ajax_ajax.asp
$(document).ready(function(){ $("#b01").click(function(){ htmlobj=$.ajax({url:"/jquery/test1.txt",async:false}); $("#myDiv").html(htmlobj.responseText); });});
Php cannot actively send data to js
So you should clarify your ideas first.
What does it mean? On the js page, I need to get a value generated by php.
$ (Function (){
$ ("# Str"). val (" ");
})
Php cannot actively send data to js
So you should clarify your ideas first.
I regret using a large brush to solve the problem.
Ajax request ~~ On the htm page, you can get the data from the php side. if it is a number or something, you can directly output the data. other data can be transmitted in json format.
Let's talk about what you want. What kind of effect will be achieved.