$.get('/path/to/file', function(data) { if(data){ //将数据塞到你的相应的dom节点中就OK了 } /});
Want to ask: does this data need PHP return $data or Echo $data. I'm not trying to make ...
Reply content:
$.get('/path/to/file', function(data) { if(data){ //将数据塞到你的相应的dom节点中就OK了 } /});
Want to ask: does this data need PHP return $data or Echo $data. I'm not trying to make ...
Echo
1 General 3 formats json,text,xml output corresponding format data $.get (url,function (Result set object) {}, ' format ') according to your corresponding situation
2 feel you don't quite understand this principle. For example, how do you judge if he is a yellow website.
1 Access to Destination address
2 Server completes a series of business logic
3 Show it
4 Your eyes have seen and told your brain 5 you know what you're doing next.
Ajax Here's the data is your eyes, return is only the 2nd step, Echo is the 3rd step, only show your data object to see, then you can use the data
Return and Echo (Print_r, etc.) are all possible, but the order is to output the return data first, and then output the echo from top to bottom.
$.get(url,function(data){ });
Do you have any questions about your URL?
To be able to return a string
Should use Echo