Toggle navigation
Run LIVE DEMO
Show CODE
LIVE DEMO PAGE
Updated: 16.10.16 20:10
Basic smartapp2.js example
<!DOCTYPE html> <html> <head> <title>A very simple smartapp2.js example</title> <!-- jQuery --> <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script> <!-- Bootstrap --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <!-- Smartapp --> <script src="http://smartapp.ikx.no/downloads/jquery.smartapp2.js"></script> </head> <body> <div id="AppContainer"></div> <script> $(function() { // Initialize app on a DOM element var $app = $("#AppContainer").smartapp2(); // Register a view on route #Hello (will be default view, as it is registered first) $app.createView("Hello", $("<div class=\"text-center\"><h1>Hello ...</h1><a class=\"btn btn-default\" href=\"#World\">Next</a></div>")); // Register a second view on route #World $app.createView("World", $("<div class=\"text-center\"><h1>World!</h1><a class=\"btn btn-default\" href=\"#Hello\">Previous</a></div>")); // Run the application $app.run(); }); </script> </body> </html>