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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ravi Dhoriya
    New Member
    • Mar 2011
    • 3

    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.otherwebsit e.com
    Code:
    <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 b greatly appreciated.
    -thanx
  • NitinSawant
    Contributor
    • Oct 2007
    • 271

    #2
    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

    Comment

    • Ravi Dhoriya
      New Member
      • Mar 2011
      • 3

      #3
      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...

      Comment

      • NitinSawant
        Contributor
        • Oct 2007
        • 271

        #4
        its not possible because same domain policy restrictions

        Comment

        • Ravi Dhoriya
          New Member
          • Mar 2011
          • 3

          #5
          Its too late to inform you guys that I've achieved it using javascript to generate an <Iframe > on otherwebsite.co m and in iframe src I kept mywebsite.com/getData.ashx.

          Thanks to all of you who replied to my thread.
          -Ravi Dhoriya

          Comment

          Working...