Why is ajax working on one server and not the next?
The person who setup the staging server placed and .htaccess in the admin side that prevented the site from accessing files in the wp-admin area.
The person who setup the staging server placed and .htaccess in the admin side that prevented the site from accessing files in the wp-admin area.
This is in wp-admin/js/common.js or wp-admin/js/common.min.js: // Scroll into view when focused $(‘#contextual-help-link, #show-settings-link’).on( ‘focus.scroll-into-view’, function(e){ if ( e.target.scrollIntoView ) e.target.scrollIntoView(false); }); Found with a search for show-settings-link in the complete source. 🙂
I added the fieldName parameter to tagit function like this: <script type=”text/javascript”> $(document).ready(function() { $(“#myTags”).tagit( { fieldName: “tages[]” } ); }); </script> Now I can echo $_POST[‘tages’]; since the HTML after execution became: <input type=”hidden” style=”display:none;” value=”d” name=”tages”> In addition, $_POST[‘tages’]; is a PHP array which I can directly put in second parameter of wp_set_object_terms. … Read more
WordPress loads jQuery in “No Conflict” mode. The $ alias does not work. This is the cause of most of the “jQuery doesn’t work” questions on this site. Your code is using that $ alias, despite the Codex warnings against doing so. Use jQuery.(document) or wrap your code like… (function($) { $(function() { // more … Read more
Got this working: Added html += ”; html += ‘<li>’; html += ‘<a href=”‘ + entry.link + ‘”>’; html += ‘<div class=”entry”>’ + entry.title + ‘</div>’ ; html += ‘<div class=”entry”>’ + entry.author + ‘</div>’ ; html += ‘<div class=”entry”>’ + entry.publishedDate + ‘</div>’; html += ‘<div class=”entry”>’ + entry.contentSnippet + ‘</div>’; html += ‘</a>’; … Read more
The reason the menu breaks is because the responsive menus are handled with a jQuery plugin. You are wiping out the jQuery object and all the jQuery plugins (which includes the responsive menu) when you include the zweatherfeed Javascript by including a second version of jQuery. The second version overwrites the first version. WordPress has … Read more
Try this: jQuery(document).ready(function() { jQuery(‘#showmenu’).click(function() { jQuery(‘.menu’).slideToggle(“fast”); }); }); WordPress hates the $ statement. If you replace it with jQuery, it should work.
$.load() is used to load content into an element. And you need to send a ping/request to a url, don’t need to use what is returned/responded. So, $.post() or $.get() the the solution for this. $.get(”, ‘wpfpaction=add&postid=350’); Usage With the current post id – $.get(”, ‘wpfpaction=add&postid=<?php the_ID(); ?>’); To dynamically add it from functions.php, you … Read more
You are mixing PHP and Javascript. The part between <script> must not be in the PHP code, but you could put it in the variable just after </form>. Another way of doing it would be to create a Javascript file myfunctions.js, putting the code into it and enqueueing it. The code would be: add_action( ‘wp_enqueue_script’, … Read more
Currently (WP 4.6) WordPress includes jquery 1.12.4, so as @toscho notes there are no compatibility issues with older IE browsers. However, it was recently announced that 1.12.4 will be the last jquery version of that branch. Sooner or later WP will have to move to jquery 3.0 branch, in which all support for IE 6-8 … Read more