Premise: The server can already process this get request and return the required data.
Excuse me: If you use this code in the html page to make a get request to the server:
<a href="/data" id="a_click">请求一些数据</a>
SoAfter the get request is issued, how do I obtain and process the data returned by the server as soon as the data is returned?
(ps: That is to say, I don’t use JavaScript to submit the get request by creating an xhr object, but use the a tag to submit it)
Front-end noobs, please don’t complain if you are a master, thank you!
A method similar to jsonp, except that jsonp is mainly used to implement cross-domain calls.
I came here for a walk around while at work. I was short on time and did not deploy the server part.
The principle is to use script tags and src attributes to set the interface address, let the server assemble the data, and return JavaScript code snippets.