Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Code for comparing .tagName misses .toLowerCase() or .toUpperCase() for XHTML #7959
after issue #7849 was closed, I found another bug that manifests when jQuery Mobile 1.4.5 is included in an XHTML page served with a Content-Type of "application/xhtml+xml".
The problem is that when using .tagName of an element, in HTML it will be returned in upper case (e.g. "INPUT") while XHTML as XML is case-sensitive and will return the tag name in lower-case ("input"). jQM has a few lines where the the tag name is compared in upper-case - this will fail in XHTML documents.
I found the following lines in https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js where the problem occurs:
isTextarea = this.element[ 0 ].tagName === "TEXTAREA",
type: this.element.get( 0 ).tagName
type = element.get( 0 ).tagName,
The code should be changed to either call .tagName.toUpperCase(), or to call .tagName.toLowerCase() and then do a lower-case comparison.