WordPress.com does not allow you to post javascript.
From WordPress.com Support:
Users are not allowed to post JavaScript on WordPress.com blogs. JavaScript can be used for malicious purposes. As an example, JavaScript has taken down sites such as MySpace.com and LiveJournal offline in the past. The security of all the blogs is a top priority and until we can guarantee scripting languages will not be harmful they will not be permitted.
JavaScript from trusted partners, such as YouTube and Google Video, is converted into a WordPress shortcode when a post is saved.
Related Posts:
- Executing Javascript When a Widget is Added in the Backend
- Loading scripts only if a particular shortcode or widget is present
- How to refresh Theme Customizer after change color inside wpColorPicker?
- Elegantly using JavaScript on widget admin forms
- Run JS after widget settings are saved?
- AJAX Contact Form Issue
- Include chat (HTML, js, css) in all pages of WordPress
- How to determine the number of widgets contained in a sidebar via customizer JS
- jQuery UI inside widget on admin page
- WP_enqueue_script() loads them always in wp_footer()?
- How do I pass the id of my widget to javascript in the form function?
- Access Customizer widget instance form
- Unable to load “wpColorPicker” on theme customize page
- Render repeatable widget fields properly with Backbone.js
- Widget outputting JS as plain text
- Simple SCript Not Displayed in WIdth
- Loading scripts only if a particular shortcode or widget is present
- Widget Admin page and Javascript enqueuing
- List.js inside WordPress widget
- Add text to Text Widget using Javascript
- Limit number of Widgets in Sidebars
- How to load Widget javascript + css files only if used?
- check if registered sidebar is active & has widget content
- How to use wp_dequeue_style() for style enqueued in WP_Widget class
- Storing custom dashboard widget options in wordpress
- Programmatically edit the text of a widget
- How can I whitelist only specific shortcodes for processing in text widgets?
- Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?
- Manual display of widget
- Customized widget area – how to override or filter class xoxo?
- How to add a description to Widgets?
- Custom Menus, Widgets & Conditional Statements
- Dynamic widgets
- How do I stop a widget from displaying on mobile site?
- cannot drag and drop widgets since wordpress 3.2.1
- Change recent posts widget title
- Color Picker Showing Twice When Widget Added to Sidebar
- Image Upload Widget Issue
- Wp Customizer event for when a new widget has been added
- Sidebar not show customizer!
- Display single widget
- Customizing wordpress default widgets?
- How to make this change without changing the core? [duplicate]
- Add pagination to listing plugin
- how to put functions inside of widgets
- How to extend WP_Widget_Media
- List of JS Events for Widgets?
- Drafts widget for admin page
- Global $wpdb is not showing correct data with function call
- Text widget doesn’t save the content
- Post ID displayed instead of title [closed]
- Color picker in widget appears twice when added via the Customizer
- Hide widget (and white space) on specific resolution [closed]
- Adding Widgets to Draft Pages
- Widget – link to page rather than absolute url
- Programmatically add widgets to sidebars
- Are widgets meant to be used outside of sidebars?
- Is there a WordPress widget for my webpage?
- Validating widget’s configuration data on Admin page
- FTP Widget Location
- Inserting Read More Tag in Widget
- dynamic sidebar in front page
- Display posts from category in post content?
- The correct way to add a JavaScript in the functions.php [closed]
- display widget checkbox selection on frontend
- Widgets in WP 4.3 disappearing – How to fix?
- Making jQuery .change() event persistent after widget save
- Widget background images missing on second blog excerpt page
- How should I add a “widget” like element?
- modifying title (in dashboard) for different widget instances
- What conditional to use for dynamic sidebar check?
- How to test if the widgetized area has any widgets?
- Saving widget gets an undefined variable
- Trouble accessing a multidimensional array to add classes to default WordPress widgets
- Distinguish between different widgets of the same type
- links to Media Library content in sidebar per page
- Why is registering a sidebar for each page causing my sidebars to reset?
- How do I customize the positioning of WordPress widgets?
- widgets in footer?
- Quick Draft widget in weird place on dashboard after being re-added
- How to fetch WordPress database values in JavaScript widget
- How can I remove WordPress element IDs and Class names in the HTML?
- Remove widgets on mobile front page without affecting desktop
- Widget display nothing
- How can I have sidebar widgets on Twenty Seventeen theme on all pages?
- Collapsible widgets [closed]
- Widget settings disappear after refresh
- How to display author meta in a sidebar widget
- Is it ok not to set widget in the main page of a one page WordPress Theme?
- How to get widget content in WordPress based on it’s ID?
- Recent Posts Widget URL / Domain change
- New Custom Widget Call a Different Widget Function
- Custom php Widget keeps disappearing from the front end
- Insert to wp_footer if widget is found in the sidebar
- Using javascript on the new widget preview / customizer page
- Custom tabs widget don’t work in google chrome, is blocked, do not change the tabs. Why?
- WordPress Hide Widget If $_Session Is Active?
- Widget which displays thumbnails, but links to urls?
- Recent posts with different class name for each post and a scrollbar?
- Use custom Javascript for a custom Elementor Widget [closed]