Threaded View

  1. #1
    Ext User
    Join Date
    Dec 2007
    Posts
    3
    Vote Rating
    0
    noelito is on a distinguished road

      0  

    Default [2.0][CLOSED] Ext.get/Ext.getDom does not fix IE's document.getElementById bug

    [2.0][CLOSED] Ext.get/Ext.getDom does not fix IE's document.getElementById bug


    I ran into a problem with my code today and found it to be one of IE's many bugs. In IE, the document.getElementById function returns by the name of an element before it looks for the id of an element. I was using Ext.get in my code and found the same bug. I would think that it should be something that Ext would remove since an IE bug should not alter how Ext works. I hope that this could be fixed.

    Here is an example:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
        <head>
            <title>Ext getElementById bug</title>
            <meta http-equiv="Content-Language" content="en-us" />
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="Content-Script-Type" content="text/javascript" />
            <meta name="description" content="This is the HEAD's description meta tag." />
            <link media="all" rel="stylesheet" href="/scripts/ext-2.0/resources/css/ext-all.css" type="text/css" />
        </head>
        <body>
            <form action="ext-ext.bug.html" method="post">
                <div>
                    <input type="text" size="50" id="description" name="description" value="This is the FORM's description input field." />
                    <button type="button" id="go" name="go" value="True">Go!</button>
                </div>
            </form>
            
            <script type="text/javascript" src="/scripts/ext-2.0/adapter/ext/ext-base.js"></script>
            <script type="text/javascript" src="/scripts/ext-2.0/ext-all.js"></script>
            <script type="text/javascript">
            //<![CDATA[
                Ext.onReady(function () {
                    Ext.get('go').on('click', function () {
                        var el = Ext.get('description');
                        var domEl = el.dom;
                        
                        if (domEl.tagName === 'INPUT') {
                            alert(domEl.value);
                        } else if (domEl.tagName === 'META') {
                            alert(domEl.getAttribute('content'));
                        }
                    });
                });
            //]]>
            </script>
        </body>
    </html>
    Last edited by noelito; 14 Apr 2008 at 10:16 AM. Reason: typo

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar