skip to Main Content

JSON not returning the actual data from the url – Jquery ajax

I am trying to build a basic covid19 website. the code I am using is only returning [object Object] in the actual data. What I am doing wrong here? <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $.getJSON("https://api.covid19api.com/summary", function(result){…

VIEW QUESTION

jQuery mega menu add/remove class on parent menu item – Shopify

I'm trying to build a mega menu in Shopify, this is what I have in my HTML: $('.has-child').on('click', function(event) { event.preventDefault(); $(this).find('.child').toggleClass('menu-visible'); $('.child').click(function(e) { e.stopPropagation(); }); }); .menu-visible{ color:red} <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <ul class="parent"> <li class="parent-main has-child"><a href="/collections">Shop</a> <ul class="child"> <li…

VIEW QUESTION
Back To Top
Search