#8069 closed enhancement (fixed)
UI demos fail from local file:// in Firefox 9 - bad tags, bad calls in demo sources
Reported by: | tshinnic | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8.18 |
Component: | [meta] ui.demos | Version: | 1.8.17 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
This failure has been asked about in at least two forum postings. One mentioned 1.8.15 but didn't mention which Firefox. And this is completely independent of the security.file.strict_origin_policy Firefox setting.
With Firebug enabled various errors become evident. Breakpoints will occur in index.html's loadDemo() routine, line 188. The error message at breakpoint will say "data.replace is not a function".
Inspecting the arguments to loadDemo() will find error messages embedded at various places in the DOM returned from the load.
The initial error message declares
XML Parsing Error: mismatched tag. Expected: </link>. Location: file:///C:/Archive/Toms/Javascript/jQuery/jquery-ui-1.8.17/demos/selectable/default.html Line Number 26, Column 3:"
The demo .html files all claim "DOCTYPE html" which I understand means strict HTML and XML. However the <link> tags are not closed, e.g. <link ..... /> . Thus this is invalid XML and Firefox barfs.
Fixing the link tags in index.html and in the .html's in ./selectable now gets us to a second error message:
XML Parsing Error: mismatched tag. Expected: </meta>. Location: file:///C:/Archive/Toms/Javascript/jQuery/jquery-ui-1.8.17/demos/selectable/default.html Line Number 26, Column 3:
Oh, look, the <meta> tags are unclosed. So fix them.
Now things seem 'better' but nothing 'works'. Wander around in the loaded data and DOM, and begin to wonder whether Firefox understands this .html file accessed by the $.get() in loadDemo() is, you know, HTML?
Read some more and find that you can declare what type of file is expected. So add a third argument to the $.get() call (at line 225 of index.html) of 'html'.
Tra-la. Selectable demo now runs in Firefox. Oooo, and still runs in Chrome "16.0.912.77 m" (well, y'know, once we know about the magic --allow-file-access-from-files option).
So, fix your .html sources to validate for XML, and force 'html' data returned from $.get().
If you really want me to do a pull request to get this fixed let me know. I would think your motivation more than mine after tonight....
Change History (4)
comment:1 Changed 11 years ago by
Type: | bug → enhancement |
---|
comment:2 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Demos: Specify the dataType when loading the demo and docs files. Fixes #8069 - UI demos fail from local file:// in Firefox 9 - bad tags, bad calls in demo sources.
Changeset: ba4335712226ecfd66d34ddc93def2433af82f8c
comment:3 Changed 11 years ago by
Demos: Specify the dataType when loading the demo and docs files. Fixes #8069 - UI demos fail from local file:// in Firefox 9 - bad tags, bad calls in demo sources. (cherry picked from commit ba4335712226ecfd66d34ddc93def2433af82f8c)
Changeset: 69daf1794d691b4aa0d2c8914383880fbc820c0d
comment:4 Changed 11 years ago by
Milestone: | 1.9 → 1.8.18 |
---|
Absolutely not.
Sounds reasonable.