Dave
Dave

Reputation: 285

Embed specific part of an existing site into another site

Is there any way of taking the table with match-history from this page (http://www.esl.eu/eu/bf3/squadrush/4on4/ladder/team/matches/7492332/) and frame/embed/include it in another site? It's for my team's website and I think tracking these matches without linking to the ESL-site would be awesome.

Upvotes: 0

Views: 3510

Answers (2)

Martin Turjak
Martin Turjak

Reputation: 21234

1) You can do it with something like php / cURL serverside.

2) Or for instant update, you could do it live with jQuery .ajax() you can call the page and extract the table and put it into the current pages DOM.

        $.ajax({
            url: 'some-page.html',
            dataType: 'html',
            success: function (result) {
               content = $(result).find("selector_of_element_you_want").html();
               $(".result").html(content);
            },
            error: function (result) {
               $(".result").html("err");
            }
        });

Upvotes: 1

Sébastien Renauld
Sébastien Renauld

Reputation: 19672

If the website has enabled CORS, sure! this is, however, doubtful. If the website has an API, you might be able to parse the information through JavaScript. If not, you're stuck with the good old-fashioned scraping ways!

I wrote an extensive answer with a detailed example for someone wanting to do the same thing: https://stackoverflow.com/a/16144603/2167834 . Hopefully this will provide a solid example of what to do. Note that it requires a server-side processing language.

Upvotes: 2

Related Questions