jQuery Mobile - Pre-rendered Popup Markup


You can use pre-rendered markup in the popup to save the startup time.


Following example demonstrates the use of popup pre-rendered markup in the jQuery Mobile Framework.

<!DOCTYPE html>
      <title>Popup Pre-rendered Markup</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

      <div data-role = "page">
         <div data-role = "header">
            <h2>Pre-rendered Popup Markup</h2>
         <div role = "main" class = "ui-content">
            <a href = "#pre-rendered" data-rel = "popup" class = "ui-btn ui-btn-inline">
               Open Popup</a>
         <div id = "pre-rendered-screen" class = "ui-popup-screen ui-screen-hidden"></div>
         <div id = "pre-rendered-popup" class = "ui-popup-container fade ui-popup-hidden 
            ui-body-inherit  ui-overlay-shadow">
            <div id = "pre-rendered" class = "ui-popup" data-role = "popup" 
               data-transition = "slideup">
               <p>Welcome to Tutorialspoint...</p>
         <div data-role = "footer">


Let's carry out the following steps to see how the above code works −

  • Save the above html code as jqm_pre-rendered_popup_markup.html file in your server root folder.

  • Open this HTML file as http://localhost/jqm_pre-rendered_popup_markup.html and the following output will be displayed.

Kickstart Your Career

Get certified by completing the course

Get Started