Ok. The solution I found out, was more simple than I thought. On the script use “jQuery” instead of “$”.
HTML trigger:
<a href="#myModal" onclick=javascript:openModal({{id}})><article>...
</article></a>
function openModal(id){
jQuery.ajax({
type: "GET",
url: 'https://www.example.json' + id,
dataType: 'json',
success: function(data) {
var data = data.T.ads;
var infoModal = jQuery('#myModal');
infoModal.find('.uk-modal-title').html(data[0].brand + ' ' + data[0].model);
htmlData="<p>" + data[0].text + '</p>;
infoModal.find('.uk-modal-body').html(htmlData);
UIkit.modal(infoModal).show();
}
});
return false;
}
Related Posts:
- merge wp rest api query to get posts per category does not work
- Full Front End, AJAX comment system and comment reply script
- Display full WordPress post under search form using AJAX
- AJAX POST Value not being returned – WordPress – AutoTrader API
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- JSON parsing error syntax error unexpected end of input
- jQuery AJAX cross domain
- Jquery Ajax Posting JSON to webservice
- TypeError: $.ajax(…) is not a function?
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- jQuery: Performing synchronous AJAX requests
- jQuery’s .on() method combined with the submit event
- How to cache json with wp-super cache
- Why use wp_send_json() over echo json_encode()?
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- WordPress function that makes HTML safe to be sent via AJAX request
- How to link WordPress heartbeat to ajax form
- AJAX returns response 0
- Drag and drop multiple file upload using Ajax WordPress
- How to securely add an Ajax button to a WP Admin page?
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- How to Use JSON With AJAX?
- WP REST API route request explain
- How to use wp_send_json_error?
- Cannot access elements of json object
- WordPress AJAX Call Not Return Result
- How to add WP API and JS featured image attachment
- jQuery Ajax passing empty parameters to my function?
- json encode not work in wordpress
- Unable to parse JSON response from wp_send_json_success [closed]
- WordPress Admin AJAX Serialize
- How to get those data using with ajax json?
- splitting the URL using jQuery
- How would you update a frontend form with AJAX
- Why is on status span no search results?
- How to handle 400 status in Ajax [duplicate]
- Refresh Markercluster after ajax call
- Cache wp-json/posts without a plugin?
- Bad request 400 from custom ajax call
- All AJAX requests return a 400 error
- WordPress Heartbeat API cannot parse data
- I can’t get a return value from Ajax
- WordPress AJAX return 0 – My case
- Retrieve JSON file from JS trough php
- Upload data from weather station to WordPress Website
- Sql formatting for post data within function
- 403 error When i send ajax request on WordPress website
- AJAX jQuery post frontend returning failed to load resource status 400
- wp_mail doesn’t work when logged in?
- Problems with wordpress nonces in Ajax call
- Ajax call in WordPress – unable to display the data on the page
- Get post content and show it in a div
- How can I wp_send_json data?
- Output multi-steps form results in same page
- Send checkbox status with Ajax / JSON and save it
- How to retrieve WP_Object that is inside an array of another array
- Chained ajax call, second call returns 0
- Can’t add classes using jQuery from a JSON string with get_body_class()
- How to display contact form 7 form in vanilla js without jquery in frontend
- WordPress Select Option Load Custom Fields
- Uncaught TypeError: Cannot read properties of undefined (reading ‘message’) [closed]
- Fetch value using AJAX in WordPress
- AJAX not working when clicking load more button, when two terms are present in tax_query
- Search live Ajax
- javascript onClick update user_meta from jquery.ajax
- WordPress POST AJAX call, var_dump($_POST) NULL and AJAX response empty when inside ob_start
- Can I use application/json content type in WordPress
- jQuery.post returns 0
- Using wp_send_json_success instead of $result[‘message’], die, etc
- Opening Modal popup on Ajax form submission
- Ajax sometimes work and sometimes just don’t work
- My function containing a mysql query launched by ajax is not working in wordpress. What am I missing?
- jQuery ajax method does not return data
- jQuery AJAX url wit variable
- React to AJAX adding to the page
- Updating Jquery object with newly created elements after AJAX call
- How to pass array from jQuery to PHP with AJAX in WordPress?
- Download doccument on server rather than clients browser
- How can i send id of the currently posted form data through json response in custom wordpress plugin?
- Ajax call works for logged in users and returns “Bad Request” for guests [duplicate]
- Javascript output now showing in custom widget
- Ajax call not working anymore
- Can’t get next post info with ajax
- Ajax by worpdress affects called jquery inside template file
- how to correctly use json_encode with ajax
- WorddPress website admin part not working correctly – I think ajax/json issue
- 403 error for ajax POST request
- Ajax WordPress pass post URLs
- AJAX Filter WHILE Loop not working WordPress
- How to populate data from JSON using AJAX in TypeScript? [closed]
- WordPress Ajax JSON success return no being recognized
- Ajax contact form returnig 0
- AJAX Call in Plugin Returns More than JSON
- jQuery AJAX add json2 dependency?
- Can’t access data from database using AJAX
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- WordPress Ajax send response on every iteration of a loop
- How to update my jquery/PHP function to add/remove user as favorites in (WordPress) users list
- AJAX call not initializing for non-admins in WordPress