|
|
Registered tutorials: 501 Registered Users: 33125
|
|
Rating: 5 out of 1 votes cast
Category: Technique Introduction
|
How to make XmlHttpRequest calls to another server in your domain
Abstract: shows how to organize cross-domain access to resources using server-side reverse proxying or bypassing XmlHttpRequest entirely.
The problem XmlHttpRequest objects are bound by the same origin security policy of browsers, which prevents a page from accessing data from another server. This has put a serious limitation on Ajax developers: you can use XmlHttpRequests to make background calls to a server, but it has to be the same server that served up the current page. Known workarounds for this limitation involve either server-side reverse proxying or bypassing XmlHttpRequest entirely. <html>
<head>
<script type=”text/javascript” xsrc=”xmlhttp.js”<>/script>
<script type=”text/javascript”>
var AJAX_URL=”http://www.fettig.net/playground/ajax-subdomain/ajaxdata.php”;
function getTime(){
getUrl(AJAX_URL, gotTime);
}
function gotTime(status, headers, result) {
document.getElementById(’time’).innerHTML = result;
setTimeout(getTime, 1000)
}
window.onload = getTime;
</script>
</head>
<body>
<div id=”time”></div>
</body>
</html>
|
Reviews:
Rate and Review This Site
No reviews yet
Statistic Information About this Resource:
| Total Hits: |
383 |
| Unique Hits: |
340 |
| |
Daily |
Weekly |
Monthly |
| |
Unique |
Total |
Unique |
Total |
Unique |
Total |
| Average |
1.1 |
1.3 |
3.9 |
4.2 |
20.4 |
22.4 |
| Current |
3 |
4 |
3 |
4 |
3 |
4 |
| Previous |
0 |
0 |
5 |
6 |
24 |
25 |
| Nov 29 |
2 |
3 |
8 |
8 |
31 |
33 |
| Nov 28 |
2 |
2 |
0 |
0 |
40 |
45 |
| Nov 27 |
0 |
0 |
3 |
3 |
19 |
23 |
| Nov 26 |
1 |
1 |
0 |
0 |
18 |
18 |
| Nov 25 |
0 |
0 |
6 |
6 |
20 |
22 |
| Nov 24 |
0 |
0 |
0 |
0 |
0 |
0 |
| Nov 23 |
0 |
0 |
7 |
8 |
24 |
26 |
| Nov 22 |
3 |
3 |
7 |
7 |
25 |
28 |
| Highest |
4 |
6 |
11 |
15 |
40 |
45 |
|
|
|
Script Execution Time: 0.1952 | SQL Queries: 10 | Members: 501
Ajax Tutorial Top List - Powered by Aardvark Topsites PHP 5.1.2
|