简体   繁体   中英

How to grab and display img from external site

I'm trying to figure out how to grab the image from an external site, in my case, http://bikerace.com/tracks/[levelCode] (as an example level code, nhx874, the url would be http://www.bikerace.com/tracks/nhx874 )

Users on bikeracelevels(dot com) have to input the level code THEN upload a screenshot. I'm trying to remove this requirement by automatically grabbing the image based on the code they input, since I could append their input code to the url, then somehow find the image (since the only image on the page would be the one I want)

How could I accomplish this? Thank you very much in advance!

Get this cross-domain AJAX plugin for use with jQuery: https://github.com/padolsey/jquery.fn/tree/master/cross-domain-ajax

Use it to load the page on bikerace.com/[levelcode], then select the image from the data as you normally would with jQuery.

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