#1129 new
igorium

any script tag right after html tag breaks call of Element as function in IE8

Reported by igorium | August 27th, 2010 @ 02:03 PM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript">
    alert("hello, I ruin your prototype.js");
</script>


<script src="prototype.js"></script>


<script>
    var el = Element("h2", {}); //this one returns Element function
    //var el = new Element("h2", {}); //works
    //var el = Element("h2", {})("h2", {}); //works
    //var el = Element.call(window, "h2", {}); //works

    el.update("some text"); //BANG! error

    window.document.body.appendChild(el); 
</script>

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Tags

Pages