I had to overcome two issues to resolve this.
The 404 error was due to the way I registered the script. It pointed to the parent theme folder, while I had saved the .js file to the child theme folder. For the moment, I’ve put a copy in the parent theme folder, and am looking for the proper way to get it registered to the child theme.
Once the browser was able to find the .js file, I got the syntax error mentioned above because I included at the beginning of the .js file. After removing all the tags and keeping only javascript code, and referencing wordpress’ jquery, the code works like a charm.
Related Posts:
- How to set time delay in javascript
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- JavaScript error (Uncaught SyntaxError: Unexpected end of input)
- My javascript is returning this error: $.ajax is not a function
- JavaScript: filter() for Objects
- Rotate image with javascript
- How to make a simple image upload using Javascript/HTML
- javascript function wait until another function to finish
- Simple throttle in JavaScript
- Enable & Disable a Div and its elements in Javascript
- Javascript – ERR_CONTENT_LENGTH_MISMATCH
- The ‘describe’ keyword in javascript
- Is there a way to enable Cross-Origin Resource Sharing for WordPress’ ajaxurl?
- How to get attachment id as soon as it is uploaded through media uploader in jquery?
- Move WordPress native javascript to bottom of page?
- RequireJS in custom theme. Working Example
- Ajax call does not activate callback function
- How to handle multiple instance of “send_to_editor” js function
- Using ‘$’ instead of ‘jQuery’ in WordPress
- Automatically decrease font size for long words
- Javascript included but alert() function not working
- Trying to get single posts to load on the front page via ajax
- Ajax not firing properly using Firefox, but works in Chrome
- wp_enqueuescript won’t load in footer even with true value set?
- jQuery Hoverintent plugin in TwentyEleven Menu [closed]
- How wp_enqueue_script works?
- Script won’t execute in the media manager
- How to properly add Bootstrap and JQuery Javascripts?
- Add colorpicker to featured image
- Gravity Forms not loading under https, jQuery is not defined
- WordPress Jquery Fade in, Fade out effect
- wp_ajax unauthenticated and authenticated
- WordPress ajax function parameter value not being passed
- Is it safe to include a javascript file in a template’s php file?
- Add a Fancybox automatically to post type “post” images
- Enqueuing javascript files
- WordPress customizer refresh screen after save
- Creating multiple enclosing shortcodes and fixing JS issues on click
- Can’t load a class into WordPress post editor’s content field
- Gutenberg Filtering Metaboxes by Post Format
- JSON output returns page source code [closed]
- No data received
- Dealing with a library that depends on jQuery
- CodeMirror on Custom Widget Textarea
- Sending click events to Google Analytics in WordPress: the easy way
- start.js:45TypeError: Not enough arguments on Safari [closed]
- How to Dynamically Load Content Into Body of Bootstrap Modal Window?
- I want to import my Json file into a custom made display-modal. How do i link my Json file?
- Help with a jQuery Carousel
- Searching multiple tags and adding jQuery dependant script onto page template?
- TinyMCE 4 remove/add attributes for all images
- videopress videos are not displayed when loading the content with ajax in a lightbox
- Call a javascript function from another file
- Fall Back Google CDN in JavaScript
- Why doesn’t jQuery use $, and how can I get it do so (GLOBALLY)?
- I have an old version of jQuery showing up. How do I figure out where it is coming from?
- How do I include javascript/jquery image resizing with wordpress?
- Loading scripts on a single page plants the script in the footer
- Search input area autogrow – how?
- Get value of selected option in select field in a WordPress form
- How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?
- Unable to get my javascript to work on my website – what am I doing wrong?
- Required radio button does not validate in form, when clicked through Javascript/jQuery
- Multiple Media uploader output to input
- Using WP functions inside javascript
- How to add external remote JS source to Gravity Forms?
- Blur.js with WordPress – Enqueued, but server not finding file
- Screen Options JavaScript Code
- Is there some jQuery conflict here?
- Theme has superfish – how to add supersubs?
- A carousel slideshow plugin in JavaScript
- Best way to add some custom javascript using jquery to a child theme
- Add JQuery As Code Snippet
- Form validation before submitting
- Defer Parsing of Scripts
- Orderby post__in Not Working Correctly?
- Site images are fixed in front of my site content [closed]
- JavaScript code do not works on online server
- JQuery toggle in Visual Composer
- jQuery not working for media uploader
- How to toggle custom WP archive list
- comment-reply.js disables any other form javascript
- WP Media Uploader modal conflicts with Bootstrap modal
- jQuery search function not running in WordPress but running locally (fiddle)
- Masonry – Can’t Find Variable imagesLoaded
- JQuery Login Dropdown not functioning in theme
- Javascript function to switch out images
- Enqueue javascript that inserts custom php widget into jQuery-constructed div
- Retrieve customizer value using ajax or customizer api and print the value in theme
- Uncaught TypeError: undefined is not a function (shortcode-box)
- Running javascript in a child theme. Works in jsfiddle
- How to block action if post is “dirty”?
- WordPress video end function [duplicate]
- wp_register_script Question
- Ensure an external javascript file called from plugin is loaded after jquery is called
- Why my vertical tab js code is refreshing the page continuously? [closed]
- bootstrap-slider.js by seiyria not working in wordpress
- Carousel Hover Image
- Individual Pages are loading halfway down
- Widget won’t work due to old JavaScript? Any ideas how to make it work? [closed]