467,146 Members | 1,064 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,146 developers. It's quick & easy.

How to get text content from another website by javascript in asp.net?

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
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="jquery.x.x.js">
  2. </script>
  3. <script type="text/javascript">
  4. $('#result').load('www.myWebSite.com/getData.ashx');
  5. </script>
  6. <body>
  7. <div id="result">
  8.  
  9. </div>
  10.  
  11. </body>
  12.  
Above code isn't working.. :(

is there any other way to send content from my website to other website??

any help would b greatly appreciated.
-thanx
Mar 23 '11 #1
  • viewed: 4249
Share:
4 Replies
100+
you need to build a server side web method[using screen scraping in asp.net] which fetches data from external site and sends it to browser

http://weblogs.asp.net/grantbarringt...ping-in-c.aspx
Mar 23 '11 #2
but... actually i want to give a javascript code to my users,
through which they can get content of a page from my website... to their website...
Mar 23 '11 #3
100+
its not possible because same domain policy restrictions

http://en.wikipedia.org/wiki/Same_origin_policy
Mar 23 '11 #4
Its too late to inform you guys that I've achieved it using javascript to generate an <Iframe > on otherwebsite.com and in iframe src I kept mywebsite.com/getData.ashx.

Thanks to all of you who replied to my thread.
-Ravi Dhoriya
Apr 29 '14 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by rn5a@rediffmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.