简体   繁体   中英

HTML SSI Include

I have 5 versions of the same html page. 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. Here is my wrapper.shtml file

<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

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

INeedToReadTheHiddenVariableInThisPage.html contains a form and several textboxes. I have a javascript in INeedToReadTheHiddenVariableInThisPage.html file (included as iframe) and it submits the form.

I need access to the hidden variable in Javascript in INeedToReadTheHiddenVariableInThisPage.html

How can I structure my files. How can I access the hidden variable.

I use apache http server.

If you put a form tag arround your input in someHiddenVariable.html then I think you can try this:

parent.document.formname.fieldname.value

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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