Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"content":{"Matrícula_RH":"10555","UserDocLanguage":"pt_BR","UserEmailHTML":"true","UserProjects":"","UserQuotaDocument":"500","UserSpecialization":"","UserWorkflowGroup":"TI","UX-APP-COMPANY":"88303375000171_0240050312_RS","WCMUserLang":"pt_BR"},"message":{"message":"OK","detail":"OK","type":"INFO","errorCode":null}}
- function executa() {
- var url = "http://10.0.0.1:8181/api/public/2.0/users/listData/teste";
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange=function()
- {
- if (xmlhttp.readyState==4 && xmlhttp.status==200){
- var json = JSON.parse(xmlhttp.responseText);
- var contador = json.length;
- alert(contador);
- }
- }
- xmlhttp.open("GET", url, true);
- xmlhttp.send();
- }
- Uncaught SyntaxError: Unexpected token < in JSON at position 0
- at JSON.parse (<anonymous>)
- at XMLHttpRequest.xmlhttp.onreadystatechange (rest.html:17)
- var json = JSON.parse(xmlhttp.responseText);
- function executa_new() {
- $.ajax({
- type: 'GET',
- url: 'http://10.0.0.1:8181/api/public/2.0/users/listData/teste',
- dataType: 'jsonp',
- success: function() {
- console.info("foi");
- }, error: function(e){
- alert('Ocorreu um erro durante a chamada ' + e);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement