Your first attempt does not work because get_template_directory_uri
returns the URL to your theme directory.
Your second attempt will work, but if you don’t want to hard code the domain you could either try using a root relative path or fetching the domain portion of your site url.
Relative path:
wp_register_script('circle-bounce', '/js/general.js', array( 'jquery', 'jquery-effects-core', 'jquery-effects-bounce'));
Domain:
$parts = parse_url(site_url());
$domain_url = $parts['scheme'] . '://' . $parts['host'];
wp_register_script('circle-bounce', $domain_url . '/js/general.js', array( 'jquery', 'jquery-effects-core', 'jquery-effects-bounce'));
Related Posts:
- What does “javascript:void(0)” mean?
- For-each over an array in JavaScript
- Cannot read property ‘push’ of undefined when combining arrays
- How can I remove a specific item from an array?
- require is not defined? Node.js
- How to pause javascript code execution for 2 seconds [duplicate]
- Getting Error “Form submission canceled because the form is not connected”
- How to implement navbar using react
- function updateMap for Google Maps API
- Loop inside React JSX
- Encode URL in JavaScript?
- JavaScript null check
- JavaScript “Uncaught TypeError: object is not a function” associativity question
- npm – EPERM: operation not permitted on Windows
- Module not found can’t resolve
- How can I get file extensions with JavaScript?
- How to detect Safari, Chrome, IE, Firefox and Opera browser?
- What does on() in JavaScript do?
- AngularJS : Factory and Service?
- What’s the difference between console.dir and console.log?
- scrollIntoView Scrolls just too far
- Javascript Uncaught TypeError : .split is not a function
- Uncaught TypeError: Cannot read property ‘msie’ of undefined
- How to hide a div with jQuery?v
- How do I pass variables and data from PHP to JavaScript?
- How do I set/unset a cookie with jQuery?
- Calling onclick on a radiobutton list using javascript
- How to properly export an ES6 class in Node 4?
- Uncaught Typeerror: cannot read property ‘innerHTML’ of null
- Sorting HTML table with JavaScript
- DOMException: Failed to load because no supported source was found
- Counting the occurrences / frequency of array elements
- how to download file in react js
- TypeError: $(…).DataTable is not a function
- Trying to use fetch and pass in mode: no-cors
- Moment.js transform to date object
- jQuery explode string like PHP
- Call Javascript function from URL/address bar
- Anagrams finder in javascript
- Validate date in dd/mm/yyyy format using JQuery Validate
- jQuery Ajax POST example with PHP
- How to validate a credit card number
- TypeError: res.status is not a function
- What is define([ , function ]) in JavaScript?
- Setting and getting localStorage with jQuery
- How to subtract days from a plain Date?
- Stopping a JavaScript function when a certain condition is met
- Showing an image from an array of images – Javascript
- Escaping HTML strings with jQuery
- AngularJS errors: Blocked loading resource from url not allowed by $sceDelegate policy
- How to use z-index in svg elements?
- How do you completely remove Ionic and Cordova installation from mac?
- What is the best way to detect a mobile device?
- How to filter JSON Data in JavaScript or jQuery?
- What’s the best way to reload / refresh an iframe?
- How do I check if a cookie exists?
- Get querystring from URL using jQuery [duplicate]
- Check if string contains only digits
- JS: iterating over result of getElementsByClassName using Array.forEach
- jQuery checkbox change and click event
- Error: listen EACCES 0.0.0.0:80 OSx Node.js
- jQuery selectors on custom data attributes using HTML5
- How to check if a value is not null and not empty string in JS
- How do I refresh a DIV content?
- TypeError: abc.getAttribute is not a function
- JavaScript single line ‘if’ statement – best syntax, this alternative?
- jquery to validate phone number
- Closing Bootstrap modal onclick
- window.location() not working, not opening page
- How to clear the canvas for redrawing
- What’s a Good Javascript Time Picker?
- JavaScript event window.onload not triggered
- Default text on input
- Pass custom fields values to Google Maps
- How do I enqueue(or delay loading of) tags in individual page posts?
- JavaScript in page doesn’t open new window [closed]
- wp_enqueue_script adds only the first script
- Add javascript to a woocommerce page template
- Dynamically insert values in a WordPress SelectControl Options field
- Vimeo froogaloop
- can a buttongroup have a label?
- Preloader for a WordPress Site
- Trying to integrate Zoho Campaign Form [closed]
- InnerBlocks restricting does not work on nested blocks
- How to open the add media dialogue it in a certain state / tab?
- How to execute Javascript on a WordPress page?
- Removing auto versioning of JS and loading to header
- How WP does Mortgage affordability calculation
- Putting custom html/js page into Elementor as it’s own block
- Drag-to-Scroll Landingpage
- Easiest way to find JS conflicts
- Nothing in dashboard that uses javascript works
- java console error about touch navigation
- Update block once an API request returns with a value
- XMLHttpRequest of admin data to public
- How do I add a class to Customizer preview based on class of Customizer control? (Customizer Javascript API)
- Open image gallery on link click
- WordPress 4.2 mce-views migration guide?
- Loaded JavaScript file not showing [duplicate]
- PHP or JS for header image rotator?