On my website I load the recent comments per AJAX for window sizes above 480px:
if ( 480 < jQuery(window).width() )
{
jQuery(document).ready(
function()
{
jQuery.get('http://toscho.de/?rc',
function(data)
{
jQuery(data).insertBefore('#inner');
}
);
}
);
jQuery('#posts').after('<div class=clear> </div>');
}
This code is quite old and not very elegant. But it may give you a hint for the right direction …
Related Posts:
- Remove WordPress scripts
- How to make an WordPress element sticky? [closed]
- JavaScript Loading Screen while page loads
- Click button copy to clipboard
- How to make html table vertically scrollable
- How to make Bootstrap carousel slider use mobile left/right swipe
- bootstrap 3 navbar collapse button not working
- How to center image in carousel
- Can Twitter Bootstrap alerts fade in as well as out?
- Play/pause HTML 5 video using JQuery
- jQueryUI dialog width
- Random background images CSS3
- How do I remove a box-shadow effect from an element when another element is hovered?
- Slide right to left?
- How to add a ” waiting” icon for an ajax in WP frontend?
- How to prevent WordPress from loading the jQuery library at the top of the page
- Automatically decrease font size for long words
- Twitter Bootstrap Use Collapse in Custom Post Type
- Stylizing external SVG files with jQuery and CSS
- Unable to run jQuery script in my template file
- modifying a template and adding jQuery to it
- Gravity list field override and adding javascript [closed]
- Is it safe to include a javascript file in a template’s php file?
- Toggle Sidebar Display
- Add a class to posts in increments of 2
- Override theme style with other CSS on a specific page
- How can I make this custom menu work?
- Will the latest Bootstrap work properly with the default WordPress jQuery?
- Accordion scrolls page too low after clicking on the title [closed]
- show/hide div with simple jQuery script [closed]
- Searching multiple tags and adding jQuery dependant script onto page template?
- What is the propre way to include jQuery UI Datepicker’s CSS in plugin?
- Superfish Menu Not Loading
- Problem Implementing parallax in header of bp-default theme
- underscore template dynamically remove row Jquery
- Is it OK combined wp-include js, jquery, css? [closed]
- JQuery load php – php file without the template
- JQuery Issues With WordPress Theme Interface
- jQuery Drill Down iPod Menu FOUC and Selecting Current page
- error: n.imagesLoaded is not a function
- jQuery Validation plugin and Bootstrap 4 CSS classes
- Getting click on item to open closest relevant element (popup) with jQuery
- How Do I change Markup of a link in WordPress
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Lightbox scroll page down on iPhone
- jQuery function not working in WordPress but works in jsfiddle
- Style sidebar for a custom page template exclusively
- Site images are fixed in front of my site content [closed]
- WP Media Uploader modal conflicts with Bootstrap modal
- :first-child applying to all links [closed]
- How to update scrollbar when using Jetpack’s Inifnite Scroller?
- Hide input field when second input field is in focus
- change the icon of a custom post type in WordPress to use twitter boostrap
- Adding css and js to a blank page created with custom template
- Drop Down Category Menu Not Working
- controlling the showing and hiding of the website logo
- How do I add Javascript and CSS files into WordPress?
- can’t make jQuery work (change image on time interval) [closed]
- Remove class using jQuery
- Set selected option of select box
- jquery loop on Json data using $.each
- JavaScript console.log causes error: “Synchronous XMLHttpRequest on the main thread is deprecated…”
- $.focus() not working
- How to modify wp.media to get and display multiple images
- wp_mail script with jQuery post
- Add a preview to a WordPress Control Panel
- Hacking TinyMCE for better usability (shortcodes and html)
- AJAX post into pop-up div
- How to include jquery validate in a template
- jQuery UI AutoComplete not working in wordpress?
- WordPress Script Loading/Unloading — wp_deregister_script(‘jquery’)
- Updating User Profile with AJAX not working
- Auto Load New Posts
- Showing Author Information and Latest Post by author in lightbox when clicked on the name of the author
- Why isn’t jQuery 2.1 loading in the header?
- Returning content via jQuery without footers on admin pages
- `wp_editor()` CSS messing up the jQuery Dialog
- Ajax, Permalinks and post_thumbnail
- How to embed JS data viz in a simple WordPress website
- First Attempt at AJAX and it keeps getting Canceled. Can’t Get Results to Show
- Edit css for search results page
- window.onload wont execute in wordpress
- Remove swfobject.js in wp_head()
- Uncaught ReferenceError: jQuery is not defined: how to fix on a sunday? [closed]
- How to use wp_update_post with ajax on frontend
- Highlight comments made by registered users of the site
- including jquery
- Customizing the Jquery Calendar [closed]
- Mobile Menu and Mobile Sidebar missing
- Dashboard controls have all stopped working
- Plugin preventing media buttons from working
- How to deregister scripts all at once
- Using jQuery DataTables and yadcf
- jQuery autcomplete not working
- jQuery dialog prints HTML-Tags under WordPress
- How can I use Page editor for two separate templates?
- Loading custom file based on a dependant file that is also dependant on another file
- Auto Sorting List Alphabetically
- Change WooCommerce Checkout Manager Datepicker to Jalali
- jQuery append only works if I select html in admin section [closed]