For example, create a folder called SpryAssets in the root folder of your web site, and move the SpryHTMLPanel.js file to it. The SpryHTMLPanel.js file contains all of the information necessary for making the HTML Panel widget interactive.
<script src="SpryAssets/SpryHTMLPanel.js" type="text/javascript"></script>
Make sure that the file path to the SpryHTMLPanel.js file is correct. This path varies depending on where you’ve placed the file in your web site.
<link href="SpryAssets/SpryHTMLPanel.css" rel="stylesheet" type="text/css" />
Make sure that the file path to the SpryHTMLPanel.css file is correct. This path varies depending on where you’ve placed the file in your web site.
<div id="myPanel">This is default text.</div>
<table width="200" border="1"> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>4</td> <td>5</td> <td>6</td> </tr> <tr> <td>7</td> <td>8</td> <td>9</td> </tr> </table>
<div id="myPanel">This is default text.</div> <script> var panelWidget = new Spry.Widget.HTMLPanel("myPanel"); </script>
This code gives the panel a name (panelWidget) and creates an HTML Panel on the myPanel element. Remember that JavaScript is case sensitive.
<div id="myPanel">This is default text.</div> <a href="#" onclick="panelWidget.loadContent("frag.html");>Load Frag</a> <script> var panelWidget = new Spry.Widget.HTMLPanel("myPanel"); </script>
This link has an onclick event that causes the content of the frag.html to load into the panel widget. The format of the method is widgetname.loadContent("pathToFragment");.