0

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.

i've tried using jQuery..
jQuery can only process requests from current server, not from other server (if i'm not wrong)

javaScript on www.otherwebsite.com

<script type="text/javascript" src="jquery.x.x.js">
  </script>
  <script type="text/javascript">
  $('#result').load('http://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

2
Contributors
5
Replies
8
Views
6 Years
Discussion Span
Last Post by rb.dhoriya
0

If your content is being pulled from a database, then you can try calling a web service in JavaScript to pull the related data to the user's site.

What exactly is it your trying to accomplish? Are you trying to create a way for people to link to your site from forum signatures, or from banners or things? like a site badge?

0

thanx 4 reply..

yes, i want to pull data from DataBase, & i want to display a site badge...
>but how to call a web service from javaScript?
how can i accomplish communication between javaScript from another server to my server's webservice?

0

bt i've triend using jQuery.......... but it wont work on.. getting data from different server... :(

1

After you create your web service, have your JavaScript point to your .asmx file, and then you'll need to parse out the given XML.

0

Its quite late to post answer.

But just to let you know how I solved this issue:

I created a js snippet for users, and they'l paste that on their website:

<script type="text/javascript" src="http://mysite.com/myjavacript.ashx"></script>

This widget would then create the form, input boxes, text information which I want to display, etc., for carrying out the query, by using document.write("Some HTML");

Edited by rb.dhoriya

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.