Skip to content

Instantly share code, notes, and snippets.

@kentaromiura
Created February 17, 2010 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentaromiura/306963 to your computer and use it in GitHub Desktop.
Save kentaromiura/306963 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Sarissa glitch with mootools</title>
<script type="text/javascript" src="sarissa.js"></script>
<script type="text/javascript" src="sarissa_ieemu_xpath.js"></script>
<script type="text/javascript" src="mootools-1.2.4-core-nc.js"></script>
<script type="text/javascript">
addEvent('domready',function(){
source = '<root><burp decibel="too much" direction="front of you" save="none"></burp></root>';
var doc = (new DOMParser()).parseFromString(source, "text/xml");
var burp = doc.selectNodes("//burp")[0];
var shoutAttr = function(attr){alert([attr.name,":",attr.value].join(""));};
/*
* This code work in ie*/
for(var i=0,max=burp.attributes.length;i<max;i++){
var attr=burp.attributes[i];
shoutAttr(attr);
}
// this throws error(s)
// $each(burp.attributes,shoutAttr);
});
</script>
</head>
<body>Foo</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment