WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10135 closed defect (bug) (fixed)

JavaScript Error In post.js When Using Internet Explorer

Reported by: brianwhite Owned by: azaozz
Milestone: 2.8.1 Priority: normal
Severity: normal Version: 2.8
Component: JavaScript Keywords: has-patch reporter-feedback Internet Explorer JavaScript
Focuses: Cc:

Description

When using Internet Explorer (but not Firefox) I receive the dreaded error "Object doesn't support this property or method" I traced the error to line 217 of post.dev.js. Evidently, IE doesn't like the way the autosave function is declared inside of the if statement. The solution was to replace "autosave = function(){};" with "var autosave = function(){};" There were no problems in Firefox regardless of how autosave was declared. It was a simple change, however, I have still attached a patch with the above change.

Steps to reproduce. Access any admin page where post.js will be loaded and autosave.js is not using Internet Explorer.

Attachments (2)

post.dev.js.diff (321 bytes) - added by brianwhite 5 years ago.
Patch for post.dev.js
autosave-error.gif (45.0 KB) - added by brianwhite 5 years ago.
Screen capture of the error.

Download all attachments as: .zip

Change History (9)

brianwhite5 years ago

Patch for post.dev.js

comment:1 Denis-de-Bernardy5 years ago

  • Milestone changed from Unassigned to 2.8.1

comment:2 Denis-de-Bernardy5 years ago

  • Keywords has-patch commit added

comment:3 Denis-de-Bernardy5 years ago

  • Keywords reporter-feedback added; commit removed

@brianwhite - andrew is having issues reproducing, and, please try this:

document.autosave = ...

comment:4 azaozz5 years ago

Or window.autosave = ... as autosave is supposed to be in the global scope.

comment:5 brianwhite5 years ago

Using Internet Explore 8 on Windows Vista.

  • Everything worked fine when using document.autosave.
  • Everything also worked fine when using window.autosave.

I do not know why IE doesn't like autosave by itself. Neither prefix should be required.

brianwhite5 years ago

Screen capture of the error.

comment:6 azaozz5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11636]) Fix the test for autosave in post.js, fixes #10135 for 2.8

comment:7 azaozz5 years ago

(In [11637]) Fix the test for autosave in post.js, fixes #10135 for trunk

Note: See TracTickets for help on using tickets.