Adding with javascript to admin bar. Works in Chrome/Safari, not Firefox

Obviously you cannot put a select tag inside a A anchor. What happens is related to event bubbling: Firefox takes the A anchor click into account, not the select control. Change your html to: <li id=”wp-admin-bar-abstractambienceantisocialapertureapzauldbackstagebig-easybiznizzbloggingstreamboastbold-newsbusy-beecaffeinatedcanvascanvas-buddypress-betachapterscinchcity-guidecodacoffee-breakcontinuumcrispcush” class=””> <select name=”themeswitcher” onchange=”location.href=this.options[this.selectedIndex].value;” style=”color: #000; text-shadow: none;”> <option value=”http://themes.fusionized.com?wptheme=Abstract” style=”color: #000; text-shadow: none;”>Abstract</option> <option value=”http://themes.fusionized.com?wptheme=Ambience” style=”color: #000; text-shadow: … Read more

Enqueuing Script in functions.php vs on the page

Go with functions.php. Use the wp_enqueue_scripts action to call this function, or admin_enqueue_scripts to call it on the admin side. Calling it outside of an action can lead to problems. See #11526 for details. Source: http://codex.wordpress.org/Function_Reference/wp_enqueue_script function themename_load_js() { if ( is_admin() ) { return; } if is_page( 123) { // Replace 123 with your … Read more

ajax and nonce when JavaScript is in a seperate file

You can localize your script and pass the nonce and ajax url to the script.Learn more about script localization. function wpse_206839() { // Register our script just like we would enqueue it – for WordPress references wp_register_script( ‘my-special-script’, ‘directory/my-special-script.js’, array( ‘jquery’ ), false, true ); // Create any data in PHP that we may need … Read more