Plugin Scripts no loading on options page

Hey use admin_enqueue_scripts. if you want to load a set of CSS and/or Javascript documents to all admin pages. You can do this from within your plugin or from your themes function file using admin_enqueue_scripts: function class_table_scripts() { wp_register_script( ‘JavaScript1’, plugins_url(‘js/wcs.css’), array() ); wp_enqueue_script(‘JavaScript1’); wp_register_script( ‘JavaScript1’, plugins_url(‘js/jquery.qtip-1.0.0-rc3.min.js’), array(‘jquery’) ); wp_enqueue_script(‘JavaScript1’); } add_action( ‘admin_enqueue_scripts’, ‘class_table_scripts’ );

How can I load certain JavaScripts only on blog pages?

Properly enqueue the scripts, via callback hooked into the appropriate hook Use contextual conditional tags to determine when to enqueue For example, you’d do something like: function wpse135482_enqueue_scripts() { // Only enqueue this script on single post pages if ( is_singular( ‘post’ ) ) { wp_enqueue_script( $args ); } } add_action( ‘wp_enqueue_scripts’, ‘wpse135482_enqueue_scripts’ ); Further … Read more

How do I get an external php page to load using javascript

If you’re trying to load a script from an external source (as your code suggests), please don’t use that article as a reference. It’s littered with bad code, and the comments on the page state several times that it’s outdated and points you to a new article. Here’s how you register and enqueue a script … Read more

How to register and enqueue JavaScript files without breaking plugin dependencies?

I would use jquery-masonry included in WordPress core: function my_scripts() { wp_enqueue_script( ‘jquery-masonry’, true ); } add_action( ‘wp_enqueue_scripts’, ‘my_scripts’ ); If you really need the standalone masonry library, you should use your “first way” but I would not use “my_masonry” as handle for the script, I would use “masonry” if you have not modified the … Read more

How do I add some javascript validation to the admin interface form’s onsubmit?

Every post / page / post type is wrapped around a universal form with the ID of #post. So if you want to validate a page before submitting it you just need to say something like: jQuery(document).ready(function($){ $(‘#post’).submit(function(){ // Validate Stuff return false; }); }); Then you’ll want to actually enqueue your javascript – View … Read more

How to install cool javascript feature in WordPress?

I’m not sure I fully understand, but this isn’t the recommended way to load js in WordPress. You normally would load scripts using a special WordPress function in your theme’s functions.php file. It’s wp_enqueue_script(). More here: http://codex.wordpress.org/Function_Reference/wp_enqueue_script By the way, WP also has its own function that essentially is used where you might use include(). … Read more