This article describes the usage of the () method. Share it for your reference. The specific analysis is as follows:
This method can pause or resume the() event.
Calling this method can delay the ready event of jQuery, which means that the ready event handling method will not be executed even though the document has been loaded.
The() method can be called multiple times to delay the ready event of jQuery. When a certain condition is met, the delay will be relieved one by one by setting the parameter of this method to false. Methods are generally used for dynamic script loading. Knowing that the script is loading is completed, then the delay to the () event is relieved by setting the parameter of this method to false.
Syntax structure:
Parameter list:
If the value is false, delay to the() event will be released.
Example code:
Example 1:
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="https:///" />
<title>I</title>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8."></script>
<script type="text/javascript">
(true);
$(document).ready(function(){
alert("I won't be popped");
})
</script>
</head>
<body>
</body>
</html>
In the above code, since (true) is added, the functions in ready() will not be executed even though the document is loaded.
Example 2:
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="https:///" />
<title>I</title>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8."></script>
</head>
<body>
<button>Click to test pop up</button>
<button >Release delay</button>
<script type="text/javascript">
(true)
$(document).ready(function(){
$("#first").click(function(){
alert("I won't be popped");
})
})
$("#second").click(function(){
(false);
})
</script>
</body>
</html>
When clicking to release the delay, it will pop up.
I hope this article will be helpful to everyone's jQuery programming.