I’m having real trouble getting e.preventDefault();
to work.
Here is my code
$('#ListSnapshot a').live('click', function(e){ var url = $(this).attr('href') +' #WebPartWPQ2 .ms-listviewtable'; $('#ListSnapshot').load(url); e.preventDefault(); });
Could someone explain what I’m doing wrong, I can see the load function work but then the page redirects to the clicked link which I need to prevent.
I have also tried moving e.preventDefault();
to the top of the function, to no avail.e.preventdefault(); not working
Related Posts:
- JSON parsing error syntax error unexpected end of input
- How to enable CORS in flask
- jQuery dialog popup
- Change Placeholder Text using jQuery
- Set selected option of select box
- $(document).on(“click”… not working?
- JavaScript console.log causes error: “Synchronous XMLHttpRequest on the main thread is deprecated…”
- how to loop through JSON array in jQuery?
- jQuery – how to write ‘if not equal to’ (opposite of ==)
- jQuery get the image src
- Create, read, and erase cookies with jQuery [duplicate]
- Toggle Checkboxes on/off
- jQuery ajax error function
- How to scroll up or down the page to an anchor using jQuery?
- Passing boolean values with wp_localize_script
- Concatenate and minify dependencies for enqueued JavaScript files
- Do I need both jquery.js and jquery-migrate.min.js?
- How to load the WordPress jquery in the section
- wordpress json custom taxonomy problem
- tinymce is not defined when not using wp_editor
- AJAX nonce with check_ajax_referer()
- Require featured image
- jQuery UI Datepicker not working
- How can I add a jQuery OnClick event to the Publish posts button?
- WordPress 5.2.1 deactivated my jQuery
- As a plugin developer, how to deal with theme developer loading jquery from google?
- Draggable item in custom gutenberg block
- Best Way to Include Scripts on a Specific Template Page
- AJAX post into pop-up div
- How to include jquery validate in a template
- chosen jquery library not loading – is not a function error
- jQuery in WordPress – Why is it not working?
- jQuery UI AutoComplete not working in wordpress?
- Updating User Profile with AJAX not working
- Auto Load New Posts
- wp_ajax() question.. not using wp_enqueue_script?
- What do I need jQuery for?
- How to include jQuery when no header and footer on the page
- Showing Author Information and Latest Post by author in lightbox when clicked on the name of the author
- Load jQuery inside Page Template
- WP Admin missing icons, numerous JavaScript errors, but only when SCRIPT_DEBUG is false
- Returning content via jQuery without footers on admin pages
- Make inline edit in wp_list_table
- Will the latest Bootstrap work properly with the default WordPress jQuery?
- jQuery is missing in wp-admin
- How to embed JS data viz in a simple WordPress website
- Rhyzz Repeatable-fields javascript in php and wordpress
- How can I integrate User generated/dynamic fields in Contact form 7?
- Using Bootstrap Switch with WordPress
- wp_enqueue_ scripts
- Yoast SEO breaking media upload
- window.onload wont execute in wordpress
- jquery does’t work
- How to fix my old theme so it loads jQuery properly
- WP Customizer compare and set a value via javascript
- Plugin Scripts no loading on options page
- Is there some way to refactor this jQuery wrapper?
- Readonly input text appears unlocked while the page is loading
- Wp theme Jquery conflict with plugins that use jquery
- Using jquery and javascript in WordPress
- Run JS function when JQ enqueued
- underscore template dynamically remove row Jquery
- fill form fields with ajax response
- Adding custom cart price with Ajax in wordpress
- Multiple selec2.js file loaded by several plugins
- Safe method to temporarily load second jquery library to wordpress
- How to use wp_update_post with ajax on frontend
- including jquery
- Name of JQuery technique used on this site [closed]
- Drag and Drop Metadata Menu Order
- need jquery help
- How to enable read more by default using jquery
- Show More Show Less – Not Working
- Show and hide element when URL contains certain section of text?
- how to allow download after newsletter subscription?
- How to insert fancybox to multiple separate galleries in a post?
- How to use jQuery plugin
- Notify user we would like them to clear their cookie. Provide a working button to clear cookies for user
- Call full image url instead of stylsheet directory url in JS for Infinite Scroll Function
- jQuery.post() calling function with parameter
- Passing variable data from external jQuery file to options.php
- Custom Javascript not working? [closed]
- What to do after a wrong RewriteRule?
- Uncaught TypeError: Cannot read property ‘ajax’ of undefined
- How to deregister scripts all at once
- Ajax autocomplete based on usercode
- Jquery script not loading on site Front page
- Get selected value with PHP and jQuery
- Javascript block in Twenty Twelve theme
- jQuery drop down not appearing for autocomplete/autosuggest
- jQuery dialog prints HTML-Tags under WordPress
- TypeError: $ is not a function Error using parallax effect in WordPress Template [duplicate]
- 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
- How to combine jQuery in-place editor with $wpdb->update
- Does anyone know how to load jquery in the footer?
- Use WordPress Built In Jquery
- Contact Form 7 – Submit Form not working After Ajax Request [closed]
- Making the Google Maps API non readable