Click here to Skip to main content
15,905,233 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Can some body help me i AM creating a project in Asp.net I Want data transferring between two websities using ajax but its not work. When i simply use ajax for recive data on 1 server its working well but when same thing i tried but now data transfer from 1 to other........

Example . I have two websites www.abc.com & www.xyz.com

now i want that if www.abc.com call any javascript function(AJAX) which take data from www.xyz.com/anypage.aspx


I am begginer so tell me that how to this can be do;;

-----------------------------------------------------------------------
I want to clear my purpose is -----------

i want share some data(content which can change any time) of a page of my site. For this i create a Ajax (javascript) Funtion and i give that .js source for add him which call it automatically after some time ? so updated data can b viewed by him

--------------------------------------------

i want to do this but when do it xmlhttp.status value is 0; and nothing happen
Posted
Updated 8-May-12 16:33pm

From www.abc.com page code,you want detail from this 'http://www.xyz.com/anypage.aspx' ,

1. are you sure 'http://www.xyz.com/anypage.aspx' is deployed and able to access through browser and be sure ,you getting data.

2. In www.abc.com use jquery and its library ,it will be easy and simple for implementing ajax.
JavaScript
$("#button").click(function(){

	var url="http://www.xyz.com/anypage.aspx";

	$.ajax({url:url,success:function(data){
        
        // if you want to alter data ,do some work here...
        $("#Display_board").html(data);
        }

       });
})
 
Share this answer
 
v2
Comments
Sandeep Mewara 8-May-12 12:05pm    
5!
vino2012 8-May-12 13:39pm    
Thank you sandeep...
rahulideasetter 8-May-12 22:20pm    
well thanks for reply Please tell me that what is mean of this["are you sure 'http://www.xyz.com/anypage.aspx' is deployed and able to access through browser and be sure ,you getting data."]

And please tell me this also do i need set or changes setting on 'http://www.xyz.com/anypage.aspx' from server or any other where--------------------

1. But when i open 'http://www.xyz.com/anypage.aspx' directly its return some string
-----------------------------------------------------------------------
2. please tell me that which functions methods i have to use from jquery

can you tell me in deep i never use jqouery
rahulideasetter 8-Jun-12 3:51am    
hey dear i want to know that what coad i have to do on server side? on www.xyz.com/anypage.aspx ???????????????

i know that coading of client side using jsonp and its working well on php so tell me that what coaidng require on asp.net page server side
This can be achieved using traditional AJAX, i.e. XMLHttprequest.

Solution 1 already covers the basics of it and how it can be implemented.

Detail here: MSDN: XMLHttpRequest[^]
 
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