Click here to Skip to main content
13,597,485 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 15 Jun 2010
Licenced CPOL

Asynchronous Cross Domain XMLHTTP

, 21 Jun 2010
Rate this:
Please Sign up or sign in to vote.
XMLHTTP solution for multiple XML Wow Armory requests
Source Code

Implemented at Sync and Async

This Code was the result of changing browser script from client to server. Cross domain requests were blocked by security when the page was served from a host site. The goal was to be able to get Wow Armory information, XML format, for multiple key values to determine the average item level of each character value. The script had to be served from a web host and accessed from common browser clients.

This solution targeted both PHP Version 5.2.13 and IIS .asp web servers. The supported browsers include Internet Explorer 8, Chrome, and Firefox.

The synchronous example from a button event waits for the result. The asynchronous example submits multiple requests and displays the results in a table.

There are three tiers of code. The browser client, the server Java script, and the cross domain bridge.

Before running the examples, copy sync.html, async.html, xmlhttpx.js, rcv_char.asp and rcv_char.php to your web site.
Switch to .asp if .php is not supported by opening xmlhttpx.js, change the AveClass()
"Rcvr" : "http://" + + "/rcv_char.asp" and save it (default was .php).

Open with your browser, http:// your web site /sync.html.

The synchronous browser client code 'sync.html' includes the script 'xmlhttpx.js' to define the class 'AveClass()'. Then it’s a matter of providing the query arguments to the armory server and pressing the iLvl button. The result (Name Average Total/Number) is shown with an alert.

Open with your browser, http:// your web site /async.html.

The asynchronous browser client code 'async.html' includes the script 'xmlhttpx.js' to define the class 'AveClass()'. A form table input boxes are used as the target of the results. The page is updated without a postback.

The middle tier script is used to cross domains, rcv_char.asp or rcv_char.php depending on the web server used.

I wrote this to learn how and borrowed ideas from everywhere. My wish list is adding SQL records containing the XML. With one real armory fetch each day.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author
Software Developer
United States United States
Writing code for 00100010 years.

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04-2016 | 2.8.180621.3 | Last Updated 21 Jun 2010
Article Copyright 2010 by
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid