简体   繁体   English

使用jquery或javascript在两个SSI之间切换

[英]Switch Between two SSI's using jquery or javascript

got a problem with a static html page which is using server side includes. 在使用服务器端包含的静态html页面时遇到了问题。

the html of the ssi has a closing head tag and opening body tag ssi的html有一个关闭的head标签和一个打开的body标签

<-- ssi start <-ssi开始

blah blah blah 等等等等等等

< /head> </头>

< body> <身体>

--> ->

is there any way to switch between two different SSI's where the tags cross boundries like this. 有什么办法可以在两个不同的SSI之间进行切换,在这些SSI中,标签会像这样越界。 i need to be able to do this for switching between mobile and desktop, and can not edit the SSI's. 我需要能够在移动设备和台式机之间进行切换,并且不能编辑SSI。 this is static HTML so the only way if there is one is using javascript? 这是静态HTML,所以唯一的方法就是使用JavaScript?

You can use AJAX to load the page, parse/replace the ssi tags, and then insert the body in a div element. 您可以使用AJAX加载页面,解析/替换ssi标签,然后将正文插入div元素。 Current mobile frameworks do that to achive page transitions, for example https://github.com/dgileadi/zepto-page-transitions 当前的移动框架这样做是为了实现页面转换,例如https://github.com/dgileadi/zepto-page-transitions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM