#33099 closed defect (bug) (duplicate)
redirect javascript will not fire
Reported by: | SaintsSQPNcom | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.2.3 |
Component: | General | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description (last modified by )
simple script i've been using for years and several WP versions no longer works after tonight's upgrade. it auto-forwards the appropriate file for today's date based on user's machine
<script language="JavaScript"><!-- var dt=new Date(); var mm=dt.getMonth(); var dd=dt.getDate(); var aryMn = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']; self.location.href=dd+"-"+aryMn[mm]; //--></script>
after update it just sits on the page that hosts the script
Change History (8)
#3
follow-up:
↓ 7
@
9 years ago
- Component changed from TinyMCE to General
Thanks for the ticket.
TinyMCE did not update in 4.2.3, so it's probably not related to that.
We also barely touched any JavaScript.
Could you please give us some more information, debug info and and a way to reproduce this issue?
#5
@
9 years ago
As a workaround, you can remove <!--
and // -->
. No browser has needed them since circa the 1990s and Wordpress itself does not use them.
#6
@
9 years ago
(I have not tested this will fix your issue, but the WP 4.3.2 changed how it parses html comments and also changed line breaks - which are significant in javascript - into spaces.)
#7
in reply to:
↑ 3
@
9 years ago
Replying to iseulde:
Thanks for the ticket.
TinyMCE did not update in 4.2.3, so it's probably not related to that.
We also barely touched any JavaScript.
A *lot* of javascript changed. These and more:
-20d3f2cf57d63060adbe47ccaae6919f *wordpress/wp-includes/js/mce-view.js 22830 -924fa693f18b70b70c3f76ad13142bb2 *wordpress/wp-includes/js/mce-view.min.js 8662 -197572f6fff30edee0fdc406462726d8 *wordpress/wp-includes/js/media-audiovideo.js 22540 -41ee8d23e04975b16e3fb8d8e949b958 *wordpress/wp-includes/js/media-audiovideo.min.js 12819 +d5bad7fcb5c9c00f9fcb77bbfbf4646a *wordpress/wp-includes/js/mce-view.js 23013 +e3a253b2b4de734d3a11a3934be5dd65 *wordpress/wp-includes/js/mce-view.min.js 8797 +f46820fc85dbf7cb188fa00f5e86eb83 *wordpress/wp-includes/js/media-audiovideo.js 22541 +adff9c3836284891ee9c5f4eacc4c708 *wordpress/wp-includes/js/media-audiovideo.min.js 12820 -71b5cb01bf11fbaea25876fb7226d560 *wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.js 20437 -8f66eb91bd871ee5a1b4e03ba3c18e84 *wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.min.js 8411 +9749243b24b6b8a96b3661f6af94577d *wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.js 20452 +b8b5f897d9f7a0a3202d16da58fa8567 *wordpress/wp-includes/js/tinymce/plugins/wpview/plugin.min.js 8490 -937d1ec0bf894d9686332fc3f71e6d22 *wordpress/wp-includes/js/tinymce/wp-tinymce.js.gz 138529 +35190a121b43780c0893ed5e92a02d60 *wordpress/wp-includes/js/tinymce/wp-tinymce.js.gz 138516
We are encountering a similar issue with a script not working. It seems to be related to TinyMCE from what we can tell. Tested both in the_content() and an ACF WYSIWYG field type - with failure. I've moved the script into an ACF non-WYSIWYG field type and it works as expected. I have also moved the script into a text widget and it works there too.