Duc Tran
Duc Tran

Reputation: 6294

What does this line of code mean in Jquery?

What does this do?

<script>window.jQuery || document.write("<script src='js/libs/jquery-1.6.2.min.js'>\x3C/script>")</script>

Upvotes: 0

Views: 889

Answers (3)

Joe
Joe

Reputation: 82584

This includes jQuery if it is not already defined.

if (typeof window.jQuery === 'undefined') {
    document.write("<script src='js/libs/jquery-1.6.2.min.js'>\x3C/script>");
}

Is basically the same thing

Upvotes: 2

Shyju
Shyju

Reputation: 218722

If jQuery is not already loaded to your page and Load it from the location mentioned.

Upvotes: 1

Eray
Eray

Reputation: 7128

IF jQuery isn't called in recently page, it's calling jQuery with adding this line to page :

<script src='js/libs/jquery-1.6.2.min.js'>\x3C/script>

Upvotes: 0

Related Questions