Dan Lister
Aug 21, 2009
  6435
(0 votes)

Self Closing Script Tags in Internet Explorer

It turns out that all versions of Internet Explorer do not like self closing script tags or as the Internet world calls it, element minimization. Self closing script tags are perfectly valid XHTML elements, but invalid HTML elements. Internet Explorer only supports XHTML to the extent that only HTML-compatible markup is possible. All other major browsers support XHTML markup.

The below example shows how this can be detected when script tags have been placed within the head element of a HTML page.

image

For the above, the 'NavTo' function would never be known to the body or other JavaScript files. In order for subsequent JavaScript files or code to be executed, the script tag of the offending element must be correctly formatted according to HTML markup standards. This will allow all browsers including Internet Explorer to successfully execute all JavaScript.

image

Aug 21, 2009

Comments

Please login to comment.
Latest blogs
Creating an Optimizely CMS Addon - Adding an Editor Interface Gadget

In   Part One   of this series, I covered getting started with creating your own AddOn for Optimizely CMS 12. This covered what I consider to be an...

Mark Stott | Aug 30, 2024

Configure your own Search & Navigation timeouts

The main blog Configure your own Search & Navigation timeouts was posted for years but you need copy the code to your application. We now bring tho...

Manh Nguyen | Aug 30, 2024

Joining the Optimizely MVP Program

Andy Blyth has been honoured as an Optimizely MVP, recognising his contributions to the Optimizely community. Learn how this achievement will enhan...

Andy Blyth | Aug 29, 2024 | Syndicated blog

Welcome 2024 Summer OMVPs

Hello, Optimizely community! We are thrilled to announce and welcome the newest members to the Optimizely Most Valuable Professionals (OMVP) progra...

Patrick Lam | Aug 29, 2024