Replacing & in JS code on pages
I ended up doing this and it works: var data = { called: ‘CAP’, captcha: $(“#captcha_txt”).val() }; $.get(“../form/master.php”,data,function(response){ …. });
I ended up doing this and it works: var data = { called: ‘CAP’, captcha: $(“#captcha_txt”).val() }; $.get(“../form/master.php”,data,function(response){ …. });
The proper way to enqueue a script is as follows: function mathJax_scripts() { wp_enqueue_script( ‘mathjax-js’, http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML’, array(), ‘2.7.1’, false ); } add_action( ‘wp_enqueue_scripts’, ‘mathJax_scripts’ ); I added the version number (2.7.1) and I flipped the final parameter to ‘false’ – that last parameter asks ‘add script to footer?’, true means yes, false means no. Then … Read more
Your code is correct, but you will not see this <script> tag in your header! The last parameter of wp_enqueue_script() is a flag regarding whether or not to load the script at the bottom of the page. You have this set to true, so you’re telling WordPress to create a <script> tag at the bottom … Read more
Since you want them to alternate the easiest would be to use show() and hide() rather than toggle(), since you don’t actually want to toggle the visibility if the login is clicked more than once, you want it to always show the #login and hide the #create. Also note that the live() function has been … Read more
Is this something you wish to achieve? <!DOCTYPE html> <html> <body> <h1>My First JavaScript</h1> <button type=”button” onclick=”var the_id=document.getElementById(‘my_field’).value; document.getElementById(‘demo’).innerHTML= document.getElementById(the_id).innerHTML;”> Click me to display some other string.</button> <p id=”demo”></p> <input id=”my_field” type=”text”></a> <div id=”someother”>Hi there!</div> </body> </html>
This plugin allows custom JS and custom CSS on a per post/page basis. https://wordpress.org/plugins/art-direction/ If you find that it is not compatible with your WP install, look for other plugins that allow custom JS and CSS. If you’re looking for a more robust solution, you can do something like the following: /* overlay-contact-form.css */ #overlayContactForm … Read more
Here’s an updated version of the code which fixes the extra zero caused by the redundant time checks in startTime(): JavaScript function startTime() { var d=new Date(); var h=d.getHours(); var m=d.getMinutes(); var s=d.getSeconds(); h = h % 12; h = h ? h : 12; // the hour ‘0’ should be ’12’ var ampm = … Read more
You are missing /wp-content/themes/YOUR_theme_NAME_FOLDER like this: function sliderimgchange(){ if ($(window).width() <= 600) { var sliderOne = $(‘.slideuno’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderone-mobile.jpg’), sliderTwo = $(‘.slidedos’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/slidertwo-mobile.jpg’), sliderThree = $(‘.slidetres’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderthree-mobile.jpg’); } else if ($(window).width() > 600) { var sliderOne = $(‘.slideuno’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderone.jpg’), sliderTwo = $(‘.slidedos’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/slidertwo.jpg’), sliderThree = $(‘.slidetres’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderthree.jpg’); } }
You can use plugin, there are few or deregister script in function wp_deregister_script( ‘scriptname’ ); But your blog will stop loading.corectlly because you need them.
This worked for me. Basically jquery was missing through <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js”> </script> and the wrong PHP tags. Thanks for that. You can find the full code below. <title> Hi all</title> <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/295053/<?php echo get_stylesheet_directory_uri().”/js/jstree/dist/themes/default/style.min.css’;?>” /> <div id=”data”> <ul> <li>One</li> <li>Two</li> <li>Three <ul> <li>Bike</li> <li>Ride</li> </ul> </li> <li>JOKE</li> </ul> </div> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js”> </script> <script src=”<?php … Read more