简体   繁体   中英

Load search results from external domain and embed

I want do load search results from one gaming website and embed into my web page. Search page have own url structure, and items are showing in <li> tags. I tried this:

<ol id="ig-panel-center"></ol>
<script>
$( "#ig-panel-center" ).load( "https://www.instant-gaming.com/en/search/?all_types=1&min_price=0&max_price=100&noprice=1&min_discount=0&max_discount=100&min_reviewsavg=10&max_reviewsavg=100&noreviews=1&available_in=RS&gametype=all&all_cats=1&sort_by=discount_asc .ig-search-items li" );
</script>

But nothing load on my web page.

So, I do not want classic iframe embeding, I want to "grab" results and show on my website. I want to make my own html struture and styling (like widget or similar).

像这样

不是这样

If you have access to or can request changes from the "external site", you can create or request a jsonp or similar (a javascript with the values you need) Then you could embed that as a normal javascript and use the values.

Otherwise your best bet is to do a server side request, and parse the result, so you can display it.

(It could be a seperate page, so you actually make an ajax request, to a page on your server, that does the request to the server - then you could also cache and pre-load this, as performance will suff some this way)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM