With the script below to get text string from a small hardware device over wifi.
The device is configured as a wifi AP & does not respond to browser request, it just updates its web data every second. I can see the data string with ip address in web page(refresh = new data) & a script tag will receive as valid data. <script type="text/javascript" src="http://192.168.4.1"> </script>
The text string is structured as multi line JS variables & is valid json.
Problem is I need to use type: "jsonp" so I don't get cors blocked but it then parses the response that for some reason is not conforming to json (even tho the data from device is valid json
I have yet to find a way to view what is actually being parsed as the Console Response Payload shows empty.
I don't care too much if the response is modified when it is assigned to my final variable as I can "parse" it / error check in JS.
<script> var RetStr // enable access to data outside ajax //----------------------- $.ajax({ url: "http://192.168.4.1/", dataType: "jsonp", // <-- dataType: "text", gives cors error (tried "jsonp text", also)