The call is simple, as long as the data is organized into JSON format: the format is as follows:
CopyCode The Code is as follows: window. onload = function ()
{
VaR TF = "if1 ";
VaR DATA = [{M: "sports site", S: [{sn: "Baidu Sports", St: "http://news.baidu.com/n? Cmd = 1 & Class = sportnews "},
{Sn: "Sohu Sports", St: "http://sports.sohu.com /"},
{Sn: "Sina Sports", St: "http://sports.sina.com.cn/"}]},
{M: "news website", S: [{sn: "Baidu", St: "http://news.baidu.com /"},
{Sn: "Sohu", St: "http://news.sohu.com /"},
{Sn: "Sina", St: "http://news.sina.com.cn/"}]},
{M: "video website", S: [{sn: "Baidu video", St: "http://vedio.baidu.com /"},
{Sn: "Sohu video", St: "http:// TV .sohu.com /"},
{Sn: "Sina video", St: "http://vedio.sina.com.cn/"}]}
];
VaR nav = new tablenav ("Table1", Data, TF );
VaR bautoclose = false; // whether to disable other navigation bars when the current navigation bar is opened
Nav. generatenav (bautoclose );
}
The example code is as follows!Xmlns = "http://www.w3.org/1999/xhtml">
Use tables to implement left-side navigation of a simple website