Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript jQuery
Here the below i have wriiten for load the webpage inside of div tag via 'url' i've enclosed. but it not working. can anyone know. pls help.
 
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<a href="#"  önClick="lurl();">Click Here</a>
<br/>
<br/>
<br/><div id="durl">
</div>
<script type="text/javascript">
function lurl(){
$('#durl').load('http://www.tndte.com/Result/');
}
</script>
</html>
		
Posted 15-Mar-13 5:32am
Comments
Marco Bertschi at 15-Mar-13 11:04am
   
Uhm..
 
Can you post the HTML text too?
hari301 at 15-Mar-13 11:40am
   
above code is full only.. starting html tag only missed.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello,
 
Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, or protocol.
 
Regards,
  Permalink  
Comments
hari301 at 15-Mar-13 11:41am
   
can u explain in some other way??
Prasad Khandekar at 15-Mar-13 16:43pm
   
Hello,
 
In your example you are trying to load contents from http://www.tndte.com/Result/. This call will succeed only if the page trying to perform this operation was served from the same domain i.e. www.tndte.com. If the page trying to perform this load operation was not originally server from the said domain then it's said to violets the Same Origin Policy and browser will restrict this call.
 
Regards,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 250
1 Jochen Arndt 155
2 PIEBALDconsult 150
3 DamithSL 125
4 Afzaal Ahmad Zeeshan 120
0 OriginalGriff 5,695
1 DamithSL 4,591
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 15 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100