I am using Security Center's API http://static.tenable.com/prod_docs/SecurityCenter_4.8_API.pdf
When using the URL in the browser I get a result; however, when trying to call it via jquery I get an error.
SCRIPT10004: Expected ; request.php, line 1, character 8
which that line is
{"type":"regular","request_id":"4666".....etc
Here is the code:
$.ajax({ url: 'https://ip/request.php?action=init&token=&module=system&input={}&request_id=4666', method: "GET", headers: { "Accept": "text/html, application/xhtml+xml, application/xml;q=0.9,*/*;q=0.8", "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, dataType: "jsonp", sucess: function(data){ $.each(data.d.results, function(i, result){ var token = result.token; console.log("Success", token); }); }, error: function(data){ console.log("Failure", data); } });
if someone could help that would be greatly appreciated..