Spittal
Spittal

Reputation: 779

Load specific content from another server into <div> using Jquery?

I'm looking for a way to take services notices off of this website;

http://mobile.bcferries.com/cc/mobile/service-notices.asp

and inserting just the list of notices (hopefully with my own custom CSS) into a div at the page load.

I'm fairly new to the jQuery library and what capabilities it has to do something like this. But if it helps I'm quite literate in Javascript, Html, and CSS.

Any help would be massively appreciated Thanks, James

Upvotes: 0

Views: 535

Answers (1)

epascarello
epascarello

Reputation: 207521

JavaScript has the same origin policy.That means it can not read the contents of another domain. Some browsers support CORS, but the site has to set up to accept those requests. If there is no API for it, you need to use a serverside language to scrape the data and proxy it from your own domain.

Anotheroption is to use a service like Yahoo pipes with JSONP.

Upvotes: 2

Related Questions