Dusty11709
New Member
Installed this script as Chrome extension. I need to get xml from http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml and then extract USD value and display as alet. What's wrong with this code?\[code\]// ==UserScript==// @name Bookmark Launcher// @description Launches bookmakrs with keyboard shortcuts// ==/UserScript==var bookmarkLauncherSetup = function() { var bookmarks = new Array(10); bookmarks['S'.charCodeAt(0)] = 'http://superuser.com'; window.addEventListener('keyup', function() { if(event.ctrlKey && event.altKey && bookmarks[event.keyCode]){ //window.open(bookmarks[event.keyCode]); //------------------------------ xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET","http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml",false); xmlhttp.send(); xmlDoc=xmlhttp.responseXML; alert(xmlDoc); USD=xmlDoc.getElementsByTagName("Cube")[2].attributes['rate'].value; alert(USD); //------------------------------ } });}var script = document.createElement('script');script.innerHTML = '(' + bookmarkLauncherSetup.toString() + ')();';document.body.appendChild(script);\[/code\]