Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery plugins 使用jQuery superfish的快速Javascript模板引擎?_Jquery Plugins_Backbone.js_Jquery Templates_Superfish_Underscore.js - Fatal编程技术网

Jquery plugins 使用jQuery superfish的快速Javascript模板引擎?

Jquery plugins 使用jQuery superfish的快速Javascript模板引擎?,jquery-plugins,backbone.js,jquery-templates,superfish,underscore.js,Jquery Plugins,Backbone.js,Jquery Templates,Superfish,Underscore.js,我有一个布局非常标准的项目,因此我怀疑这是一个常见问题: <body> HEADER-CONTAINER DIV - includes superfish jQuery menu plugin but am open to other menu options if necessary. CONTENT-CONTAINER DIV - depending on the page, contains several other jQuery plugins, HTML, javaScr

我有一个布局非常标准的项目,因此我怀疑这是一个常见问题:

<body>
HEADER-CONTAINER DIV - includes superfish jQuery menu plugin but am open to other menu options if necessary.
CONTENT-CONTAINER DIV - depending on the page, contains several other jQuery plugins, HTML, javaScript, etc.
FOOTER-CONTAINER DIV
</body>
我正在寻找一种优雅且性能良好的方法,让superfish菜单单击加载CONTENT-CONTAINER DIV中的新内容。内容包含HTML和javaScript。我还希望解决方案能够更改URL,这样,如果有人稍后返回/my/页面,它将重新加载到正确的位置,类似于我对Backbone.Router的理解


有什么建议吗?如果可能,请提供一个链接,指向加载到div示例中并运行加载中包含的任何javaScript的页面。

Superfish与否这不是一个真正的问题。每当您向页面添加html时,浏览器将执行任何javascript或加载此新html片段将包含的任何javascript文件

因此,当您单击菜单,加载或生成新的html并用新内容替换内容div时,浏览器将执行脚本


您必须重新绑定新插入内容上的所有事件,因为jQuery将无法跟踪这些事件。

我四处搜索,找到了一个不错的示例,演示了如何获取任何url并重新加载div。在中找到的示例感谢您的回复。我对这种方法有相当的了解,我正在寻找一个例子,用您描述的新内容替换contentdiv,并处理URL路由。请阅读主干网中路由器的文档。至于替换content div$.content.html就是全部了。