This project is archived and is in readonly mode.

#196 ✓invalid
Clarke Brunsdon

XmlBody on Request in IE does not have mootools Element extensions

Reported by Clarke Brunsdon | July 5th, 2008 @ 10:02 PM | in 1.2.1

After making a request for an XmlDocument in mootools, Firefox and other browsers are able to access the mootools extensions (.get, for instance) in the resulting document, but IE can't.

The following fails in IE.

Assumes '/validXmlFile.xml' exists and is valid.

<html>
	<head>
		<script language="javascript" src="mootools.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript">	
			
			window.addEvent('domready',function(){
				
				var request = new Request({
					url: '/validXmlFile.xml'
				});
				request.onSuccess = function( textBody, xmlBody ) {
					var element = xmlBody.documentElement;
					alert(element.get)
				};
				request.onFailure = function( instance ) {
					alert(instance);
				};
				
				request.send();
			});
			
		</script>
	</head>
	<body>
		A test for selecting XML
	</body>
</html>

Comments and changes to this ticket

  • Tom Occhino

    Tom Occhino October 6th, 2008 @ 08:19 AM

    • Assigned user changed from “Valerio” to “Tom Occhino”
    • State changed from “new” to “invalid”
    • Milestone changed from 2.0 to 1.2.1
    • Tag changed from 1.2release, core, defect, ie, request, xmlbody to defect, ie, request, xmlbody

    This is a shortcoming of IE, and unfortuately can't easily be fixed with MooTools as IE doesn't treat the nodes the same way it treats HTMLElements. If the XML document does in fact contain Elements, then you should be able to wrap the xmlBody.documentElement in a call to the $ function to extend it (just like we always do with all other elements)

    Also, your example code is wrong... You should never override the methods of an instance like this. (you must use events)

    request.addEvent('success', function(){ ... });

    etc.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages