Builder.node does not extend Element on IE6 & IE7
Reported by andy k | August 10th, 2008 @ 01:51 AM
In IE6 and IE7, Builder.node creates nodes do not have Prototype Element functions (update, observe, and I assume others)
FF, Safari, Opera all work
Element.extend(node) fixes the problem.
I fixed this at the source by adding to Builder.node right before the return
if(!element.update) Element.extend(element);
That may not be the best way to solve the problem but it does work in FF(linux&win),IE(6&7),Safari(Win),Opera(Win)
Sample code (if you add node=Element.extend(node) after the line where the node is created, this will work)
<html>
<head>
<script src="prototype.js" type="text/javascript"></script>
<script src="scriptaculous.js" type="text/javascript"></script>
</head>
<body>
<ul id="list"></ul>
<script>
var node = Builder.node('li',{id:'item1'});
if(node.update)
node.update("FOOBAR");
else
alert("node.update does not exist")
$('list').appendChild(node);
if(node.observe)
node.observe('dblclick',function(event) {alert(event.target.id)})
else
alert("node.observe does not exist")
</script>
</body>
</html>
Comments and changes to this ticket
-
Thomas Fuchs August 28th, 2008 @ 08:09 PM
- → State changed from new to resolved
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
script.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.
Source available from github
The Git repository resides at:
http://github.com/madrobby/scriptaculous
Check out the current development trunk with:
git clone git://github.com/madrobby/scriptaculous.git
As script.aculo.us 1.xx is feature-frozen, this development trunk is for bugfixes only.
New development should happen only for
script.aculo.us 2.
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post a an example that shows off the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
