5

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.com' , 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...

Rahul garg
  • 9,202
  • 5
  • 34
  • 67
  • 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 Nov 29 '11 at 11:16
  • i m using java at server side.. – Rahul garg Nov 29 '11 at 12:16
  • a helpful link http://code.google.com/appengine/docs/java/urlfetch/overview.html – unloco Nov 29 '11 at 12:30

3 Answers3

2

Use jQuery ajax

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

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

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

hungryMind
  • 6,931
  • 4
  • 29
  • 45
1

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

kommradHomer
  • 4,127
  • 5
  • 51
  • 68
0

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.com");

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

Gourav

Gourav khanna
  • 1,381
  • 1
  • 11
  • 15