jquery syntax

jquery syntax

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>First jQuery-Enabled Page</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript">
        $("document").ready(function() {
            alert("The page just loaded!");
        });
    </script>
</head>
<body>
</body>
</html>

Shortest form of jquery syntax


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>First jQuery-Enabled Page</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript">
        $(function() {
            alert("The page just loaded!");
        });
    </script>
</head>
<body>
</body>
</html>