Quantcast
WoWInterface - View Single Post - Need help to integrate Addon-Options
View Single Post
03-06-15, 06:44 AM   #45
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Hab Dir das Javascript-Beispiel unten mal etwas erweitert:

Code:
<html>
<body>
<span id="demo">test</span>
<script>
var xmlhttp=false;
if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
   xmlhttp=new XMLHttpRequest();
   }
 else
   {// code for IE6, IE5
   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
   
 
   var domains = ["fr", "de", "pt"];
   var items = [109125, 109126, 109127];
   var domCount = 0;
   var itemCount = 0;

 xmlhttp.open("GET", "http://" + domains[domCount] +".wowhead.com/item=" + items[itemCount] + "&xml",true);
xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {
		document.getElementById("demo").innerHTML =  document.getElementById("demo").innerHTML + "<br/>"  + items[itemCount] + " " + domains[domCount] + " " + xmlhttp.responseXML.documentElement.getElementsByTagName("name").item(0).firstChild.nodeValue  ;
		itemCount = itemCount + 1;
		if(itemCount >= items.length){
			domCount++;
			itemCount = 0;
		}
		if(domCount < domains.length)
			{
			xmlhttp.open("GET", "http://" + domains[domCount] +".wowhead.com/item=" + items[itemCount] + "&xml",true);
			xmlhttp.send(null);
			}
}
}
 xmlhttp.send(null);
 
</script> 
</body>
</html>
[e]
Mit RU kommt mein Beispiel irgendwie nicht klar. Schätzungsweise ein Unicode-Problem. Musst Du rausfrickeln.

Last edited by Duugu : 03-06-15 at 06:49 AM.
  Reply With Quote