Sunday, 13 June 2021

Jquery basic syntax

Basic document ready syntax

 $(document).ready(function () {

    console.log("ready!");

});

Jquery selector, anchor under all ul->li, add css class, remove css class

$("ul li > a").click(function () {

    $("ul li > a").removeClass('active');

    $(this).addClass('active');

});

Get windows URL

http://localhost/menuname.de?foo=bar&number=0

var pathname = window.location.pathname; // Returns path only (/path/example.html)
var url = window.location.href; // Returns full URL (https://example.com/path/example.html)
var origin = window.location.origin; // Returns base URL (https://example.com)


No comments:

Post a Comment

Search This Blog

Creating your first "Alexa" Skill

Index What is Alexa What is Alexa Skill? Why is it required when Alexa already equipped with voice assistant? Dev...