-2

When we use jQuery load() we can define a DIV on the external page we want to load into our content.

Is there a similar way to get the html data from a specific DIV from an external page? Something like this?

var url = someurl;
var div = specificdiv
    $.get(someurl+' '+specificdiv , function(data) {
        $('#target_div').html(data);
    });
elbatron
  • 675
  • 3
  • 16
  • 30
  • 1
    This is a job for AJAX! Although not sure if you'll have issues with cross-domain urls. BTW: this might help - http://stackoverflow.com/questions/2496491/jquery-ajax-success-function-not-rendering-html-with-jquery-ui-elements – Yzmir Ramirez Sep 10 '11 at 18:52
  • Thanks. That was quick. Update my question shortly. – elbatron Sep 10 '11 at 19:05

1 Answers1

-2
$('#target').load('http://example.com/someurl.html #specificdiv');
chown
  • 51,908
  • 16
  • 134
  • 170
Rimantas
  • 1,471
  • 9
  • 6