the backend uses C-sharp. The data returned to the front end is shown in the figure below. How to convert it to JSON? Should this situation be handled at the back end or at the front end?
the backend uses C-sharp. The data returned to the front end is shown in the figure below. How to convert it to JSON? Should this situation be handled at the back end or at the front end?
use the rule to get the JSON string in the tag first
/[^><]+(?=<\/string>)/img
then convert to JSON
JSON.parse()
xml with json, inside had better let the backend peel off the outer layer
you treat xml as html, and xml can also use DOM api
such as JQ
var str = $(data).find('string').html()
//xml
var str = $( $.parseXML( data ) ).find('string').html()
Thank you all!
the answer found on the Internet has been successfully converted to JSON.
function success(result){
if(typeof(result) == "object"){
result = result.lastChild.firstChild.nodeValue;//xml
eval("result = "+result);//json
}
}
source = "><<>sadas"; Regex Reg = new Regex(@"(?is)(?<=<P>).*?(?=< P>)", RegexOptions.IgnoreCase); var Content = Reg.Match(source).Value; js (?is)(?<=<P>).*?(?=< P>) ...
the company outsourced the project to someone else to do it, and now it is necessary to log in without login. The login of the project is to use the account password to call the API and store the data in cookie, then judge the cookie, and then enter the ...
error message We do not provide support for this pre-release version. You may encounter build failures or other breakages. = > Installing dependencies for tmux: pkg-config, makedepend, Libevent = > Installing tmux dependency: pkg-config = > Downloa...
http: wechat.cnzjcf.com Sele. my server just hangs a blank txt document and its access speed is not as fast as his ...
according to the description in the 1-JS-SDK usage permission signature algorithm in Appendix JS-SDK of Wechat JS-SDK ( URL is here ), a signature needs to be calculated when using jssdk, and a timestamp needs to be provided when calculating the signatu...
website is developed by asp.net mvc when opened, locate the current city based on the customer s IP address, and then switch to the content of the corresponding city (switch cookie) now the city is judged by ip in baseController, and then switch the ...
Front-end js code var reader = new FileReader(); reader.readAsArrayBuffer(file); excel reader.onload = function () { alert("load"); var blob = new Blob([reader...
node has its own asynchronous feature. Does async await execute code in a Synchronize way? while C-sharp comes with Synchronize feature, is async await designed to execute code asynchronously? is this understood correctly? ...
is to click on the payment in Mini Program and then jump directly to the payment code page of Wechat? How is this function implemented ...
I want to go back to the browser local time (not server time) at the front end of js, and page_load can be used in the cs background. I don t know if there is any way ....
A website is someone else s system, B website is my own system, A website has a link to visit B site, want to click on the link to access B site, copy or manual input can not access B site. After doing it for two days, I don t know how to realize it. I...