UNPKG

jquery-load-json

Version:

jQuery plugin that enables developers to load JSON data from the server and load JSON object into the DOM.

52 lines (39 loc) 1.66 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery Mobile List</title> <link rel="stylesheet" href="../jquery.mobile-1.0rc2.min.css" /> <script src="../scripts/jquery-1.6.4.min.js"></script> <script src="../scripts/jquery.mobile-1.0rc2.min.js"></script> <script src="../../../src/jquery.loadJSON.js"></script> <script language="javascript" type="text/javascript"> $(document).ready(function () { }); </script> <script language="javascript" type="text/javascript"> $( '#listpage' ).live( 'pageinit',function(event){ $('li').loadJSON('list.js'); }); </script> </head> <body> <div id="listpage" data-role="page"> <div data-role="header"> <h1>Loading array of companies into the list</h1> <a href="index.html" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a> </div><!-- /header --> <div data-role="content"> <p>Similar to the standard version, in the JQuery mobile application you can load list of JSON elements into the list. In this example is shown how the list of elements can be populated using the JSON array. This is a mobile version of the <a ref="../list.html">standard list example</a></p> <ul data-role="listview" data-inset="true"> <li> <a href="details.html" data-ajax="false" class="ID"><span id="Name" class="Name"></span></a> </li> </ul> </div><!-- /ui-body wrapper --> </div><!-- /page --> </body> </html>