0
<html>
<head>
<script  src="http://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>

<body>    

<div id="target-div"></div>
<div id="error"></div>
<div id="success"></div>

<script>

//$('#target-div').load('https://example.com.au');

$( "#success" ).load( "https://example.com.au #divId", function( response, status, xhr ) {
    $( "#success" ).html( response );
  if ( status == "error" ) {
    var msg = "Sorry but there was an error: ";
    $( "#error" ).html( msg + xhr.status + " " + xhr.statusText );
  }
});
</script>

</body>
</html>

I get this response

Sorry but there was an error: 0 error

I tried <iframe> but whole website get load with <iframe> while I just need to load particular section , I tried "<iframe> with div id but no luck.

learner
  • 73
  • 1
  • 9

1 Answers1

0

You most likely won't get this to run the way you imagine because of a cross-domain issue see this answer

Greg K.
  • 1,005
  • 2
  • 12
  • 20