Added JS file shown in view page, but gives 404 error when clicked
-
After the following code has been created in the child theme’s function.php,
add_action('wp_enqueue_scripts', 'js_files'); function js_files() { wp_register_script('ajax_call_mkto', get_template_directory_uri() . 'js/something.js', array('jquery'), false); wp_enqueue_script('ajax_call_mkto'); }
I checked the view page source and clicked on the link to see if it works, after clicking it, it gives me a 404 Not Found page. Is there something wrong with my JS file?
var $k = jQuery.noConflict(); $k('#something .somethinghere("yolo")').click(function() { var $this = $k(this); // Ajax call ajaxConnection($this); }); function ajaxConnection(item) { alert('IT WORKS!'); }
Thanks,
Halben
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Added JS file shown in view page, but gives 404 error when clicked’ is closed to new replies.