Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello...

I'm creating a web application in asp.net in which I would like to give user a one JavaScript code, through which the user can get content from my website to his/her own website.

I've used one generic handler to process user request in my website.
so, now How can I do this, i've tried using jQuery..
jQuery can only process requests from current server, not from other server (if i'm not wrong)

Code on www.otherwebsite.com
<script type="text/javascript" src="jquery.x.x.js">
 </script>
<script type="text/javascript">
 $('#result').load('www.myWebSite.com/getData.ashx');
 </script>
<body>
 <div id="result">

 </div>

 </body>


Above code isn't working.. :(

Is there any other way to send content from my website to other website??
any help would be greatly appreciated.

-thanx
Posted
Updated 23-Mar-11 5:06am
v2

1 solution

It sounds like you want to make a cross-domain AJAX request, so you should use JSONP. Your getData.ashx page should be changed to respond to a JSONP request. Read this article for more information: JSON to JSONP: Bypass Same-Origin Policy[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900