|
|
Registered tutorials: 501 Registered Users: 37765
|
|
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,%20gotTime);
}
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: |
437 |
| Unique Hits: |
392 |
| |
Daily |
Weekly |
Monthly |
| |
Unique |
Total |
Unique |
Total |
Unique |
Total |
| Average |
0.9 |
0.9 |
3.4 |
3.6 |
20.7 |
22.4 |
| Current |
2 |
2 |
7 |
7 |
13 |
13 |
| Previous |
2 |
2 |
2 |
2 |
22 |
24 |
| Feb 18 |
0 |
0 |
4 |
4 |
20 |
21 |
| Feb 17 |
3 |
3 |
0 |
0 |
24 |
25 |
| Feb 16 |
0 |
0 |
5 |
5 |
31 |
33 |
| Feb 15 |
1 |
1 |
0 |
0 |
40 |
45 |
| Feb 14 |
0 |
0 |
6 |
7 |
19 |
23 |
| Feb 13 |
0 |
0 |
0 |
0 |
18 |
18 |
| Feb 12 |
0 |
0 |
7 |
7 |
20 |
22 |
| Feb 11 |
1 |
1 |
3 |
4 |
0 |
0 |
| Highest |
4 |
6 |
11 |
15 |
40 |
45 |
|
|
|
Script Execution Time: 0.13233 | SQL Queries: 10 | Members: 501
Ajax Tutorial Top List - Powered by Aardvark Topsites PHP 5.1.2
|