Open lroffia opened 6 years ago
Loading the JSAP via AJAX is fine:
<script type="text/javascript"> window.addEvent("domready", function() { var ajaxRequest = new Request({ url : "mqtt.jsap", onSuccess : function(jsap) { subscribe2(jsap,"OBSERVATIONS"); } }).send(); }); </script>
Using a variable to store the JSAP causes the error:
<script> function onLoad() { subscribe2(jsap,"OBSERVATIONS"); } var jsap = '...' </script>
It's quite strange, cause it's parsed by native javascript call JSON.parse.
How do you call the constructor? How JSPA is stored?
It is not related to the JSAP api. It depends on how the jsap is specified (as variable or file)
Just tried. It still fails.
Il giorno 04 mag 2018, alle ore 12:40, Cristiano Aguzzi notifications@github.com ha scritto:
Did you store the string with backticks?
Have a look here https://stackoverflow.com/questions/805107/creating-multiline-strings-in-javascript?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arces-wot/SEPA-js/issues/5#issuecomment-386564194, or mute the thread https://github.com/notifications/unsubscribe-auth/AOgdcZgB4oUYM0IoxjzsjhvjrMxKbl2Lks5tvDA4gaJpZM4TyaUu.
Exception
Validated with: https://jsonformatter.curiousconcept.com/
The JSAP works fine with the Java APIs.
Here the JSAP: