-1

I'm doing a cross domain request with JSONP (with jQUery). But the server where I do the request on is just a simple .txt file which get updated real time.

I cannot access the domain nor change how the data is given. It's like how it is on the link.

http://www.zro.be/v1/pll/playlist.txt

There's info about a bridge (if it's open or closed) which I need to parse. I get the required data but I get an error

Uncaught SyntaxError: Unexpected token &

I think it's because of the weird markup of the data.

&nu=Mojo Dreams - Met Mark Verbert ( Do 20-21U )&straks=Gotye - In Your Light&vorige=Blondie - Maria&zro=ZRO's selection&brug=Zelzate brug vrij voor wegverkeer

How can I make it run expecting all data, so free text allowed? So I don't get the Syntax Error.

Many thanks

Jesse

Jesse
  • 544
  • 5
  • 24
  • @MarcB kidding me? It's not my JSONP ... It's the data I get from a server which isn't in my control. Don't downvote for such stupid things. Read the question first. – Jesse Apr 16 '15 at 20:18

1 Answers1

1

How can I make it run expecting all data, so free text allowed?

You can't. JSONP has to be JSONP, not free text.

I cannot access the domain nor change how the data is given.

If you can't change anything on the server, then the only way to make a cross origin request is to use a proxy so your JavaScript makes the request to the same origin.

Community
  • 1
  • 1
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335