i think the script.js
file is not loading properly. if its loading then the function should work as expected.
are you referencing the complete path of script in your script.js call? like
<script type="text/javascript" src="https://wordpress.stackexchange.com/questions/256287/some-domain.com/path/widget.js"></script>
try opening that file from page source and see if its loading the correct js file?
its always best practice to use wp_enqueue_script
function for loading js files.
Related Posts:
- How to call WordPress PHP file using external js file
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- Creating Log-In Page for backend server
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- I was wondering if it’s possible to implement card.js on WordPress
- Find the method which AJAX GET calls
- AJAX Filter WHILE Loop not working WordPress
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- Calling header from JavaScript file
- How to create a radio button to alt between settings in wp_options table
- Ajax not updating to database
- WordPress 404 when using AJAX to call php function
- wordpress ajax pagination
- WordPress AJAX load post metadata in modal
- how use php query in AJAX jquery
- jQuery doesn’t work in my php snippet
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- Ajax Load more CPT via shortcode
- Form not working as it should in WordPress, but in a normal HTML site it does
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- Add a downloaded JS file to WordPress
- Submitting my form to the database and then redirecting to payment site
- Slider from different widgets
- Querying posts based off a jquery datepicker
- AJAX Not Working With WordPress Database properly
- How to call javascript function (jquery) in a shortcode?
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Pass the updated value of aid from form using ajax
- ajax form with multiple submit buttons and values
- How to run ajax in WordPress Post?
- 500 (Internal Server Error) of external php file
- Adding unique marketing messages between certain products whilst using isotope/Infinite Scroll
- Pass php to database in JQuery: With AJAX?
- Use jQuery and AJAX to get HTML
- How can I correctly POST to a WordPress page?
- No Authors for custom post type
- Adding instant search to wordpress page
- Fatal error: Call to a member function get_results() on a non-object in on line 26
- Add php function into .js file (for tinyMCE button)
- Why this plugin is not working?
- Combining fancybox with multiple thumbnail plugin
- Dynamic Gallery
- Trying to fix multiple category drop down
- What is the best way to get the first few post from WordPress in different divs using a loop?
- Missing items on page
- Adding javascript files to WordPress and jQuery version
- I am trying to call external database recieving error
- Highlight posts currently being edited on multiple editor site?
- How to change links in the 3 main categories, on widget category, to a javascript function call
- jQuery vs. $ – Creating jQuery scripts in JavaScript in WordPress using External Libraries
- reorder a WP_Query, using a dropdown
- best way to communicate between php and jquery/javascript
- Loading a post’s content, into a div outside the loop, when it’s title is selected in a list
- Cannot get custom javascript to execute on page
- Fatal error: Uncaught Error: Call to undefined function wp_nav_menu()
- Edit Image/Image Details – Replace button missing
- ajax form function error
- Add specific phrase after every product title including the discounted price? [closed]
- why my “recepie” category is not taken into account in my request
- AJAX: WordPress filters inside $html do not work as intended
- Adding Custom JQuery Menu Fresh Slide Out
- Why not showing all post by default in my jquery filter
- ACF repeater image in video poster with jquery
- Load Meta box value into div AJAX [duplicate]
- Jquery autosave text area after typing
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- Use ajax response in PHP function
- JSON Object Value Show Undefine
- Adding jquery using php function
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- Different behaviour between “include_once” and directly echoing out html code?
- notify users when changed database
- How to use js variable to php in wordpress functions.php
- Replace the image of a product with its video in the shop page
- getJSON response to PHP
- ajax problems on loading page [closed]
- generate excerpt from the part of big text dump that contains keyword
- Upload multiple files via ajax from an HTML file input
- get_post_meta returns on side but it doesn’t return on bottom of admin page
- Help with AJAX request
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- Retrive the value of the Active variation of the product and then link it to the “read more” to dynamically change
- custom AJAX filtering logic and outputting results into an Elementor Loop Grid widget
- JQuery UI Autocomplete showing as bullets
- Partial refresh in WordPress live preview
- Help with uploading file with AJAX and PHP
- Help with creating commenting system using PHP, jQuery and AJAX
- Update shortcode values using ajax call
- How to add icon to WooCommerce add to cart button
- ajax select parent show child in another select and show posts in another select-ajax filter search
- Can’t find elemnts on the DOM using Custom Control in Customizer API
- Why jquery arrray return 0 value
- Translating the “Everything” filter menu in Quicksand jquery file
- How to save WordPress post and attachment images from front end using media library?
- Add/Remove User Meta Array via AJAX
- How do I ensure that the URL parameters are updated correctly when multiple filters are applied