0

I have a website I'm trying to read some text from another website the data is like below:

CNUM: 4G987
TIE:
TIEA:
XPHONE: 1-111-111-111
XPHONEA:
INFOPHONES:
FAXTIE:
FAX:
PAGER:
PAGERID:
PAGERTYPE:
CELLULAR:

I'm using jquery as the following:

$.getJSON("http://xxx.xxx.com/xxx/wsapi?byInternetAddr=xxx&**callback**=?", function(result){
}); 

the problem: if put in the link "&callback=?"-----> will be get as JSONP format and Im getting this err:

SyntaxError: identifier starts immediately after numeric literal

if i did this:

$.get("http://xxx.xxx.com/xxx/wsapi?byInternetAddr=xxx&**callback**=?", function(result){
});

I'm getting:

Cross-Origin Request Blocked: The Same Origin Policy disallows

Any suggestion on how to deal with this?

Kyle
  • 330
  • 1
  • 4
  • 13
  • 2
    You are not able to load it, that is what the same origin policy means. You could probably use some server side script for it. But are you allowed to get the information from that other website? – putvande Jun 04 '15 at 20:30
  • any chance you could change the output format from the web server you are reading from? you would need to wrap it in curly brackets {} and add commas at the end of each entry except the last one. – hexerei software Jun 04 '15 at 20:32
  • any suggestion on how to get info from another website? – Kyle Jun 04 '15 at 20:32
  • @hexereisoftware no I can not – Kyle Jun 04 '15 at 20:32
  • I think you have to pull the other site data in your server side and then return it to your client side – ItayB Jun 04 '15 at 20:37
  • @Ravi i would then write a local php script, that reads the url and returs Data as JSON String. Very simple! – hexerei software Jun 04 '15 at 21:17

0 Answers0