Click here to Skip to main content
Click here to Skip to main content

Tagged as

Asynchronous Cross Domain XMLHTTP

, 21 Jun 2010 CPOL
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://" + top.location.host + "/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.

License

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

Share

About the Author

Weberto.com
Software Developer
United States United States
Writing code for 00100010 years.

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.141022.1 | Last Updated 21 Jun 2010
Article Copyright 2010 by Weberto.com
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid