Skip to content
Related Articles
Open in App
Not now

Related Articles

jQuery Mobile Loader resetHtml() Method

Improve Article
Save Article
  • Last Updated : 20 Jan, 2022
Improve Article
Save Article

jQuery Mobile is a web-based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be using the jQuery Mobile Loader resetHtml() method to resetHtml the loader widget.

Syntax:

$( ".selector" ).loader( "resetHtml" );
$.mobile.loading( 'resetHtml');

Arguments: This method does not accept any arguments.

CDN Links: Add the below jQuery Mobile scripts that will be needed for your project.

<link rel=”stylesheet” href=”//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.css”>
<script src=”//code.jquery.com/jquery-3.2.1.min.js”></script>
<script src=”//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.js”></script>

Example: This example demonstrates the jQuery Mobile Loader resetHtml() method.

HTML




<!doctype html>
<html lang="en">
  
<head>
    <meta charset="utf-8">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1">
    <link rel="stylesheet"
          href=
"//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.css">
    <script src=
"//code.jquery.com/jquery-3.2.1.min.js"></script>
    <script src=
"//code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.js">
    </script>
  
    <script>
        $(function () {
            $("#show").on("click", function () {
                $.mobile.loading('show');
            });
  
            $("#btn").on('click', function () {
                $.mobile.loading("resetHtml");
                alert("resetHtml methos is triggered");
            });
        });
    </script>
</head>
  
<body>
    <center>
        <div data-role="page" id="page1">
            <div data-role="header">
                <h1 style="color:green;">GeeksforGeeks</h1>
                <h3>
                    jQuery Mobile Loader resetHtml() Method
                </h3>
            </div>
            <div role="main" class="ui-content">
                <div data-role="controlgroup" id="GFG">
                    <button id="show" data-theme="b">
                        Default loader
                    </button>
                </div>
            </div>
            <input type="button" id="btn" style="width:250px;" value="resetHtml">
        </div>
    </center>
</body>
  
</html>


Output:

jQuery Mobile Loader resetHtml() Method

 jQuery Mobile Loader resetHtml() method

Reference: https://api.jquerymobile.com/loader/#method-resetHtml


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!