最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Fetch Data form External URL clientside - Stack Overflow

programmeradmin3浏览0评论

I want to fetch data like (title,some description) from any external URL the user enters.

Like in facebook, when we copy an external url , it fetches some information from that url..

Is there any way to do it clientside by some jquery plugin or something... ?

EDIT : Like say in facebook status , i copy 'www.stackoverflow' , it fetches title, and some more information from it ; I need to have quite similar thing . Isn't there any jquery plugin that can fetch similar basic info from url...

I want to fetch data like (title,some description) from any external URL the user enters.

Like in facebook, when we copy an external url , it fetches some information from that url..

Is there any way to do it clientside by some jquery plugin or something... ?

EDIT : Like say in facebook status , i copy 'www.stackoverflow.' , it fetches title, and some more information from it ; I need to have quite similar thing . Isn't there any jquery plugin that can fetch similar basic info from url...

Share Improve this question edited Nov 29, 2011 at 12:20 Rahul garg asked Nov 29, 2011 at 7:57 Rahul gargRahul garg 9,3725 gold badges36 silver badges67 bronze badges 3
  • 2 both jquery ajax and iframe won't help you because you wanna request crossdomain data. ajax doesn't work for external domains and iframe with external "src" is not accessible by client side scripts please tell us what's your server side scripting language ! – unloco Commented Nov 29, 2011 at 11:16
  • i m using java at server side.. – Rahul garg Commented Nov 29, 2011 at 12:16
  • a helpful link code.google./appengine/docs/java/urlfetch/overview.html – unloco Commented Nov 29, 2011 at 12:30
Add a ment  | 

3 Answers 3

Reset to default 2

Use jQuery ajax

jQuery.ajax( url [, settings] )
jQuery.get( url [, data] [, success(data, textStatus, jqXHR)] [, dataType] )

http://api.jquery./jQuery.get/

http://api.jquery./jQuery.ajax/

if you want to just display something , you can use iframe element , setting its source dynamically with jQuery.

If you mean retrieving the Html code from a webpage, you can use the WebClient.DownloadString method:

WebClient client = new WebClient();
String htmlCode = client.DownloadString("http://videoonfacebook.");

After that you can filter what ever you want .like TITLE,DESC etc.. Hope this help

Gourav

发布评论

评论列表(0)

  1. 暂无评论