redditor
redditor

Reputation: 4266

Cross Domain AJAX query

With the help of Stack overflow I currently have this JSFiddle: http://jsfiddle.net/WskJT/

I have an aspx file on another server (cannot access this, so amendments to that server are not an option) and offline (php include not an option) I would have a page that pulls this data & removes columns as per the above fiddle.

Is there any workaround to be able to get this data from the aspx file & display (something similar to) the output the the above fiddle?

I'm an enthusiastic novice so I apologise if I haven't worded this correctly etc.

Thanks in advance!

Upvotes: 1

Views: 247

Answers (1)

Mendhak
Mendhak

Reputation: 8775

Despite the server being on your intranet as you have indicated in your comments you will face security issues as pointed out. What you could do is create a 'proxy' web service in the same domain as your main page.

Start by creating a 'service.php' file on your own server. From there, make the necessary curl calls to the ASPX page on the other server. Any time service.php (or call it proxy.php if you like) is called, it in turn calls the ASPX page, with any parameters as required. Have it read the output text and return the text to the caller itself.

Point your AJAX code to the 'service.php' file.

Now your javascript calls are in the same domain and you shouldn't have the permission problems you were facing with the JavaScript.

Upvotes: 3

Related Questions