cors - ODATA and $getJSON - SyntaxError: missing ; before statement -
i consuming odata service under development , running locally. getting consumed jquery using below code. javascript rendered nintex form hosted in sharepoint environment in different domain.
browser used testing 'firefox'
var url = "http://localhost:57368/odata/employeesleaves('340674')"; $.getjson(url + "?callback=?", function (data) { alert('coming...'); });
i can see json object in firebug/firefox, error in console 'syntaxerror: missing ; before statement "odata.metadata":"http://localhost:57368/odata/$metadata#employeesleaves/@el'
any highly appreciated!
thanks
neeraj matta
the webapi service been accessed, cors not enabled on it.
below link enabling cors on web service.
http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api
Comments
Post a Comment