开发者

What's causing my HTML elements to appear with tons of inline JavaScript? How can I stop it?

开发者 https://www.devze.com 2023-01-08 00:46 出处:网络
I\'m currently working on a page that uses a HTML wrapper supplied by the client. We inject our content into the wrapper and then render the page.

I'm currently working on a page that uses a HTML wrapper supplied by the client. We inject our content into the wrapper and then render the page.

This wrapper links to other JavaScript libraries. When I inspect the element, I can see that one of my elements has been modified to appear as the following:

开发者_如何学JAVA<li class="directory-result-text" fire="function() {
      return __method.apply(null, [this].concat($A(arguments)));
    }" observe="function() {
      return __method.apply(null, [this].concat($A(arguments)));
    }" stopObserving="function() {
      return __method.apply(null, [this].concat($A(arguments)));
    }" visible="function() {

    <!--..and it goes on like this for a while...-->

    }">

We use jQuery and none of our elements ever appear like this. Can somebody please tell me what might be causing this and how I can prevent it from happening to our content?


got the same thing here, a call to prototype's $() on an element does that, but I don't know why.

(only on IE btw)

after further looking, those attributes are all methods Prototype adds to extend the DOM, but when you add properties on an element object in IE, it seems that it adds them as attributes also.

0

精彩评论

暂无评论...
验证码 换一张
取 消