Try like this…
<script> function getPaging(str) { $("#loading-content").load("dataSearch.php?"+str, hideLoader); } </script> <li onclick="getPaging(this.id)" id="1">1</li> <li onclick="getPaging(this.id)" id="2">2</li>
or unobtrusively
$(function() { $("li").on("click",function() { showLoader(); $("#loading-content").load("dataSearch.php?"+this.id, hideLoader); }); });
using just
<li id="1">1</li> <li id="2">2</li>
Related Posts:
- jQuery equivalent of JavaScript’s addEventListener method
- Jquery .on(‘scroll’) not firing the event while scrolling
- jQuery multiple events to trigger the same function
- javascript is not working on Event Submission?
- How to fire jQuery after $(window).on(‘load’)
- jQuery $(this) keyword
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- Disable button in jQuery
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- How can I get the ID of an element using jQuery?
- How do you select a particular option in a SELECT element in jQuery?
- My javascript is returning this error: $.ajax is not a function
- Installing jQuery?
- Email validation using jQuery
- Wildcards in jQuery selectors
- jQuery: How can I create a simple overlay?
- Invalid or unexpected token on a very simple function
- XML Parsing Error: not well-formed in FireFox but good in Chrome
- jQuery get value of selected radio button
- How to make Bootstrap carousel slider use mobile left/right swipe
- How to get a cross-origin resource sharing (CORS) post request working
- How to use radio on change event?
- Adding a page loader using jQuery
- jquery – return value using ajax result on success
- Using OR operator in a jQuery if statement
- Resource interpreted as Document but transferred with MIME type application/json warning in Chrome Developer Tools
- Is jQuery included in WordPress by default?
- Creating Multiple wp_localize_script for Shortcode?
- Basic WordPress AJAX Call
- wp_enqueue_script won’t load in header?
- Hide pages from google and visitors
- jQuery Hoverintent plugin in TwentyEleven Menu [closed]
- How wp_enqueue_script works?
- Cannot access elements of json object
- Script won’t execute in the media manager
- Basic ajax call in WordPress
- jQuery Validate wp_editor
- How do I setup nested repeatable option fields?
- What are best practices for including jquery plugins
- wp_enqueue_scripts hook is not being called
- wp_ajax unauthenticated and authenticated
- How to enable the content editor as a droppable target with jQuery-ui?
- Enqueue Google CDN jQuery in Footer
- ‘jQuery is not defined Error’ appearing in load-scripts.php
- Firebug : Problem with jQuery in WordPress admin panel
- JSON output returns page source code [closed]
- Display data on same page as form without refresh
- Override theme style with other CSS on a specific page
- Ajaxify calendar
- Problem with tables (huge data) on Word-press site
- Gravity Forms – jQuery in List Field [closed]
- start.js:45TypeError: Not enough arguments on Safari [closed]
- Dropdown filtering extremely slow
- Fall Back Google CDN in JavaScript
- wp_enqueue doesn’t work
- filterable portfolio with wordpress and jquery
- Trouble enqueueing jquery with custom theme
- WP-admin redirects to login after adding SSL certificate
- Dynamicaly update field created with wp_editor()
- I have an old version of jQuery showing up. How do I figure out where it is coming from?
- add custom HTML css with js doesn’t work
- How to change background image from WordPress Gallery
- Search input area autogrow – how?
- Populating shortcode values dynamically in theme template
- WordPress Rotating Background Images
- Change quantity via jQuery and disabile quantity field [closed]
- Trying to Load jQuery
- Get value of selected option in select field in a WordPress form
- Jquery contact form to send mail to admin [closed]
- jQuery – Toggle megamenu submenu items by click
- General Settings: display custom plugin field after Site Address field
- WordPress Insert not working with ajax
- WP AJAX API with JS file
- need to override function in jquery.ui.datepicker.js
- Can user meta be shown or hidden depending on user logged in status?
- Screen Options JavaScript Code
- Is there some jQuery conflict here?
- Theme has superfish – how to add supersubs?
- How to modify iFrame content in an admin thickbox
- jquery bookmark links
- Storing current page WP list table HTML data into a PHP variable
- jQuery .html rendering [closed]
- bundled jquery in theme js not working with wp_localize_script
- jQuery not working for media uploader
- How to toggle custom WP archive list
- Adding text to links when not on the homepage
- how to remove/exclude html coding from json file while export?
- WordPress and Raty.js
- JQuery is not defined but jquery script is loaded in source [closed]
- search in jquery mobile returns blank page
- owl carousel not working after ajax load [duplicate]
- Uncaught TypeError: undefined is not a function (shortcode-box)
- jquery not working correctly in plugin options page?
- jQuery AJAX add json2 dependency?
- Group posts by weekly or monthly
- How to read the contents of single post through RSS feed
- WordPress video end function [duplicate]
- jQuery cycle thumbnails?
- Sliders with buttons [closed]
- Enqueued jQuery not working