mmcw
asked on
Javascript and using SSI exec command
Hello,
I have the following problem using SSI together with
Javascript on MSIE or NEtscape or other browsers.
The folowing code wil look if you use frames or not.
The frame parts are called down and down_wevers.
There are 3 frame parts.
The script will work without SSI. I use it on othere applications.
I have now the following problem.
I wan't to use the exec SSI command.
But it must only be executed when goodlocation is not true and goodlocation_wevers is also not true.
I put the command to the else part.
But only putting it there will result in always executing the script as soon the html file is read by a browser.
I wan't it only be executed when the goodlocations are false!!!
I have tryed also the following.
<script language="JavaScript">
<!--
function FrameRedirectAXS()
{
goodlocation=false
goodlocation_wevers=false
if (parent.frames.length != 3) goodlocation=false;
if (parent.frames.length == 3) {
if (parent.frames[1].name == "down") goodlocation=true;
if (parent.frames[1].name == "down_wevers") goodlocation_wevers=true;
}
if (goodlocation == true) document.write("");
else if (goodlocation_wevers == true) document.write("");
else document.write("<--#exec " + "cgi=\"/cgi-bin/axs/ax1.pl \"" + "-->");
}
//-->
</SCRIPT>
This wil result in a line <--#exec cgi="/cgi-bin/axs/ax1.pl"- ->
this is the SSI line command.
But this tiime it will not be executed.
The browser will write down the
<--#exec cgi="/cgi-bin/axs/ax1.pl"- -> line and do noting with it.
It is possible for me to use SSI and I use it in SHTML files.
I call the javasript by using:
<SCRIPT LANGUAGE="JavaScript">
FrameRedirectAXS()
</SCRIPT>
How can I solve this problem????
Greeting Michel Weegerink
E-mail: mmcw@worldonline.nl
I have the following problem using SSI together with
Javascript on MSIE or NEtscape or other browsers.
The folowing code wil look if you use frames or not.
The frame parts are called down and down_wevers.
There are 3 frame parts.
The script will work without SSI. I use it on othere applications.
I have now the following problem.
I wan't to use the exec SSI command.
But it must only be executed when goodlocation is not true and goodlocation_wevers is also not true.
I put the command to the else part.
But only putting it there will result in always executing the script as soon the html file is read by a browser.
I wan't it only be executed when the goodlocations are false!!!
I have tryed also the following.
<script language="JavaScript">
<!--
function FrameRedirectAXS()
{
goodlocation=false
goodlocation_wevers=false
if (parent.frames.length != 3) goodlocation=false;
if (parent.frames.length == 3) {
if (parent.frames[1].name == "down") goodlocation=true;
if (parent.frames[1].name == "down_wevers") goodlocation_wevers=true;
}
if (goodlocation == true) document.write("");
else if (goodlocation_wevers == true) document.write("");
else document.write("<--#exec " + "cgi=\"/cgi-bin/axs/ax1.pl
}
//-->
</SCRIPT>
This wil result in a line <--#exec cgi="/cgi-bin/axs/ax1.pl"-
this is the SSI line command.
But this tiime it will not be executed.
The browser will write down the
<--#exec cgi="/cgi-bin/axs/ax1.pl"-
It is possible for me to use SSI and I use it in SHTML files.
I call the javasript by using:
<SCRIPT LANGUAGE="JavaScript">
FrameRedirectAXS()
</SCRIPT>
How can I solve this problem????
Greeting Michel Weegerink
E-mail: mmcw@worldonline.nl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also please remember that the script is inside comments
<SCRIPT><!--
--></SCRIPT>
and any SSI inside the script will never be executed even if you could make it work.
What is inside the ssi - could it perhaps be coded differently or can you have an
html file you load into a hidden frame that contains the ssi?
as in
if (goodlocation == true) {document.write("")};
else if (goodlocation_wevers == true) {document.write("")};
else self.location = 'ssihtml.html';
Michel
<SCRIPT><!--
--></SCRIPT>
and any SSI inside the script will never be executed even if you could make it work.
What is inside the ssi - could it perhaps be coded differently or can you have an
html file you load into a hidden frame that contains the ssi?
as in
if (goodlocation == true) {document.write("")};
else if (goodlocation_wevers == true) {document.write("")};
else self.location = 'ssihtml.html';
Michel
Why not put the <SCRIPT><!-- and --></SCRIPT> and the rest of the html in the
/cgi-bin/axs/ax1.pl, then you could even do a
if (goodlocation == true) {document.write("")};
else if (goodlocation_wevers == true) {document.write("")};
else self.location = '/cgi-bin/axs/ax1.pl';
Michel
/cgi-bin/axs/ax1.pl, then you could even do a
if (goodlocation == true) {document.write("")};
else if (goodlocation_wevers == true) {document.write("")};
else self.location = '/cgi-bin/axs/ax1.pl';
Michel
Did the above accepted answer solve your question?
If yes, how and if not why accept it?
Michel
If yes, how and if not why accept it?
Michel
ASKER
It is not exacly what I mean al those answers but I now know that it is not possible in javascript and solved the problem an other way. Thank you for your support
Would you then in the future please reject the answer or have the customer services remove it?
Otherwise it will be autograded and put in the pool of accepted answers and Visible_Man's answer is a wrong rehash of the version answered in the CGI area.
Michel
Otherwise it will be autograded and put in the pool of accepted answers and Visible_Man's answer is a wrong rehash of the version answered in the CGI area.
Michel
Hope this clears things up,
Josh