If you want to edit javascript code, is better to disable the html WYSIWYG html editor from your user profile. Without it, the above PHP file is useless.Ĭreate a new folder inside the one above and call it “ js.”Ĭreate a new text document and paste this code into it:jQuery(document). Do not use the html editor that comes with Moodle. Now we need some JavaScript to control incomplete form confirmation in WordPress. This will cause the plugin to fail when trying to add it to WordPress.Ĭreating the JavaScript for the Confirmation Plugin When saving a PHP file in applications like Notepad, don’t forget to change the “Save as file type” to “All Files.” Otherwise, you’ll create a text document and not a PHP file. Run Size: 281 x 106 let x 5 let y 6 let z x + y 11 Try it Yourself Click on the 'Try it Yourself' button to see how it works. Save this file as “ confirm-leaving.php” in your folder. JavaScript Editor With our online JavaScript editor, you can edit HTML, CSS and JavaScript code, and view the result in your browser. Wp_enqueue_script( ‘Confirm Leaving Form’, plugins_url( ‘js/confirm-leaving.js’, _FILE_ ), array(‘jquery’), ‘1.0.0’, true ) Īdd_action(‘wp_enqueue_scripts’, ‘wpb_confirm_leaving_js’) * Description: This plugin shows a warning to users when try they forget to hit submit button on a comment form. Paste the following code in your text editor (replace “” with your domain):
0 Comments
Leave a Reply. |