I am calling an API command(“@ReportProperty2(45899,exportdata,‘16115898’)@”) which returns HTML of the button but in string format and > and < are in > and < and there are double quotes are well which breaks my code at the following line:
Hi @asifakhtar, there seems to be some loss of information…
You mean escaped as HTML entities (< and >) or URL encoded (%3C and %3e)?
Is that the exact response, including the wrapping quotes? In this case the response might be supposed to be a JSON string… so we’d need to know 1) what the Content-Type header of the response is, 2) how openwp() processes the response, and 3) how you are eventually attempting to insert the response body into the DOM.
As for the quotes I’m not really sure, the response is wrapped in regular double quotes and also includes unescaped double quotes? Or is this maybe supposed to be a JSON string? In this case you might just parse it like so:
tmp.innerHTML = JSON.parse(response)
console.log(tmp.textContent) // Should now give you the desired output