Scripts shouldn’t go inside the body of a post, but it is possible for administrator level users.
See the codex info on Javascript_in_Posts.
If you need JS inside a post, chances are you’re approaching it from the wrong angle, content should go in the content area, not code.
However if you’re looking to run code when something specific appears in a post, a better approach(imho) is to use a shortcode(or several), you can read more about them here.
Related Posts:
- Scripts at the end of the page
- Display a consistent Google Plus icon on ALL pages of my site
- Pass user role to javascript code inside body
- How to use custom Javascript code inside a plugin?
- How to add specific script to WordPress webpage that will working with user input and databases
- Why can I not deregister my style and script on custom post type?
- Enabling plugin on specific pages and subpages
- Adding javascript to header of MetroMagazine theme
- How to disable specific plugin in mobile version?
- Is there an earlier hook than login_head or login_enqueue_scripts?
- Best approach to fetch data from wp options to js file or php file
- Can someone please tell me what is wrong with my plugin?
- Updating the Drag-To-Share eXtended share URLs?
- wordpress site | All-in-one-cufon IE Issue
- Enqueue WordPress plugin scripts below all other JS
- How to add Internationalization in WordPress using Javascript/React?
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- Change upload folder for a CPT
- How to get the element ID from new menu list that added with add_filter()?
- Override Plugin Script Fucnction in WordPress
- Time consuming callbacks in customizer
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- add image crop function like in wp customizer
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Executing Javascript when a New Post is Published
- Set featured image using javascript in post editor
- Display encrypted content on my website
- Is there a standard way to listen for an on change event of a posts featured image
- How to edit content before post update
- Trying to create a private area custom for each user where they upload images to a server [closed]
- wp.media javascript issue with on select
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- add input in custom javascript from WordPress pages/posts
- Advanced AJAX Page Loader ignores other JS code
- How to insert HTML/JavaScript form into WordPress page? [closed]
- accessing wp.media api from a tinymce plugin
- Add custom JavaScript that is a combination of CDN/uploaded files and easily-edited code?
- How to load wp_editor via AJAX
- Redux Framework: Page freezes on typing in Editor
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- WordPress 3.8.3. custom theme – sliders won’t load js/css files
- Using TinyMCE in plugin?
- Using window.onload with Ubermenu
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Add script into front from my plugin
- Redirect to another page using contact form 7? [closed]
- Is there a loading priority for login_enqueue_scripts?
- Delay JavaScript files from loading
- “Conflict” with jQuery (or its plugins)?
- JavaScript in a PHP plugin
- Deactivate JS Script in Plugin Shortcode
- how to prevent all css and javascripts files from loading
- Remove / overwrite some functions in buddypress.js
- wordpress add_action() issue in ajax call
- Register Script in Plugin Widget
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Localizing methods for jQuery append prepend wrap parent
- How to connect rating to individual comments?
- Minimizing scripts & css files that plugins add
- How to execute a plugin on a single page only?
- how to insert a HTML form into a javascript popup?
- MediaElement.js works on one site but not the other?
- Which plugin can do horizontal scrolling of RSS feeds in WordPress [closed]
- Can inactive WordPress plugins still load scripts?
- Add type to enqueued script inside plugin
- After updating the WordPress getting a syntax error in the console
- How to generate an all in one WordPress New content, plugin and theme update report on a website? [closed]
- get specific value of a array | PHP
- How to get specific string/value from an array? php [closed]
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- How use wp media upload liberary in react components?
- Access post title from custom meta box on title change
- Background Music WP [closed]
- Automatic WordPress Clone Backup
- Why does my jQuery plugin show up as text in WordPress?
- Adding a simple Javascript file with a plugin
- JQuery needs to be defined in , but Gravity Forms is defining it in the
- Disable submit button order
- Conditional custom redirect
- Executing Javascript in Plugin
- Social share buttons text shows up on post excerpts
- Meta slider plugin only works after first refresh – Object has no method ‘flex slider’
- Load CSS files in header of Bones theme?
- how to request a script more than once in wordpress
- How to turn off automatic operation for Nivo Slider?
- How to enqueue some javascript source once per page
- Dropdown menu on click change
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- WordPress Stats Plugin: Display Post Views [closed]
- Javascript from Easy-Fancybox place into footer
- CSS/JS files in WordPress
- How do I override all stylesheets and scripts without a plugin
- Wp-minify doesn’t seem to minify my JS code
- Plugin Admin panel checkbox unchecked after submit
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- How do I minify a plugins CSS/JS code?
- Custom Plugin scripts from admin working in frontend