Hi!
Ich habe folgendes Problem, bei dem ich leider etwas hänge:
Ich habe eine Hauptseite der Gestalt:
``
<html>
<head><title>egal</title></head>
<body>
<iframe src="wichtig.xml" name="wichtig"></iframe>
</body>
</html>
[/code]
wichtig.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="wichtig.xsl"?>
<document>
<data></data>
<init></init>
</document>
wichtig.xsl:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<script type="text/javascript">
function init()
{
document.forms.wForm.someVal.value="fooBar";
document.forms.wForm.target="wichtig";
document.forms.wForm.submit();
}
</script>
</head>
<body style="text-align:center; margin:0; padding:0;background-color:#cccccc;">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="data">
<form method="post" name="wForm" id="wForm" action="/cgi-bin/my.cgi" target="wForm">
<input type="hidden" name="someVal" value=""/>
</form>
</xsl:template>
<xsl:template match="init">
<input type="button" value="load settings" style="margin:1%" onclick="init()" />
<script type="text/javascript">
init();
</script>
</xsl:template>
</xsl:stylesheet>
Ergebnis der Transformation im Iframe:
<head>
<script type="text/javascript">
function init()
{
document.forms.wForm.someVal="fooBar";
document.forms.wForm.target="wichtig";
document.forms.wForm.submit();
}
</script>
</head>
<body style="text-align:center; margin:0; padding:0;background-color:#cccccc;">
<form method="post" name="wForm" id="wForm" action="/cgi-bin/my.cgi" target="wForm">
<input type="hidden" name="someVal" value=""/>
</form>
<input type="button" value="load settings" onclick="init()" />
<script type="text/javascript">
init(); //(*)
</script>
</body>
</html>
Wenn ich auf "load settings" drücke, wird das Formular übertragen.
Aber mit dem init();//(*) erfolgt leider keine automatische Übertragung. Alle aufgerufenen Adressen sind im gleichen Adressbereich.
Warum wird init() nicht ausgeführt?
Auch wenn ich (*) durch window.setTimeout("init()",1000) ersetze, wird init() nicht übertragen.
FF Fehlerkonsole meldet: nichts
Apache Error log meldet: nichts
Testausgabe (in file) im CGI meldet: sich nicht, es sei denn der Aufruf erfolgt mittels des "load settings".
Ich bin echt für jeden Tip dankbar,
Richard