简体   繁体   English

HTML SSI包含

[英]HTML SSI Include

I have 5 versions of the same html page. 我有5个版本的同一个html页面。 All the contents in the page is the same except for one hidden variable. 除一个隐藏变量外,页面中的所有内容均相同。 I use the hidden variable for tracking something important. 我使用隐藏变量来跟踪重要的事情。

I am trying to see if I can rewrite this by including a html with hidden variable. 我正在尝试查看是否可以通过包含带有隐藏变量的html来重写它。 Here is my wrapper.shtml file 这是我的wrapper.shtml文件

<html>
<body>
    this is the superb page
    <!--#include file="someHiddenVariable.html" -->
    <iframe frameborder="0" height="400" scrolling="no" src="/INeedToReadTheHiddenVariableInThisPage.html" width="280"></iframe>
</body>
</html>

someHiddenVariable.html just has someHiddenVariable.html刚刚有

 <input type="hidden" value="something very important" />

INeedToReadTheHiddenVariableInThisPage.html contains a form and several textboxes. INeedToReadTheHiddenVariableInThisPage.html包含一个表单和几个文本框。 I have a javascript in INeedToReadTheHiddenVariableInThisPage.html file (included as iframe) and it submits the form. 我在INeedToReadTheHiddenVariableInThisPage.html文件(包含为iframe)中有一个javascript,它提交了表单。

I need access to the hidden variable in Javascript in INeedToReadTheHiddenVariableInThisPage.html 我需要访问INeedToReadTheHiddenVariableInThisPage.html中Javascript中的隐藏变量

How can I structure my files. 我该如何构造我的文件。 How can I access the hidden variable. 如何访问隐藏变量。

I use apache http server. 我使用apache http服务器。

If you put a form tag arround your input in someHiddenVariable.html then I think you can try this: 如果您在someHiddenVariable.html中将表单标签放在输入周围,那么我认为您可以尝试以下操作:

parent.document.formname.fieldname.value parent.document.formname.fieldname.value

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

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