WiseGuy
asked on
What's the big difference between local html and downloaded html
I have an html file that works perfectly when I open it locally, but when downloaded from the web it doesn't work.
Here's the url to the file:
http://www.fcuitgeest.nl/EE_Test.html
Here's the text:
<HTML>
<HEAD>
<TITLE>Cross-Window Write</TITLE>
<SCRIPT>
newwindow=window.open();
newdocument=newwindow.docu ment;
newdocument.write("<html>< head>");
newdocument.write('<!DOCTY PE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');
newdocument.write('<title> ANWB Routeplanner</title>');
newdocument.write('<BASE HREF="http://anwb.tensingsks.com/anwb/" >');
newdocument.write('</HEAD> ');
newdocument.write('<BODY bgProperties=fixed BACKGROUND="Image3.jpg" onload="window.moveTo(0,0) ; if (document.all) { top.window.resizeTo(screen .availWidt h,screen.a vailHeight )};documen t.frm.acti on.value = 1;document.frm.submit();"> ');
newdocument.write('<form name="frm" action="/anwb/scripts/tgig w.dll" method="post">');
newdocument.write('<input type="hidden" name="countryid0" value="0">');
newdocument.write('<input type="hidden" name="RMODE" value="FAST">');
newdocument.write('<input type="hidden" name="countryid1" value="0">');
newdocument.write('<input type="hidden" name="pcid0" value="58826">');
newdocument.write('<input type="hidden" name="TEMPLNAME" value="zoek_route_tussen.h tt">');
newdocument.write('<input type="hidden" name="REDIRURL" value="http://anwb.tensingsks.com/anwb/scripts/tgigw.dll?APP=ANWBMS&CMD=ROUTE&OUTPUT=HTML&">');
newdocument.write('<input type="hidden" name="app" value="anwbresolve">');
newdocument.write('<input type="hidden" name="cmd" value="resolve1">');
newdocument.write('<input type="hidden" name="pc0" value="1911TR" >');
newdocument.write('<input type="hidden" name="pc1" value="1624AA" >');
newdocument.write('</form> ');
newdocument.write('</body> ');
newdocument.write('</html> ');
newwindow.history.go(0);
// start polling for load finish
//setTimeOut("newwindow.st op()",2500 );
</SCRIPT>
</HEAD>
</HTML>
Here's the url to the file:
http://www.fcuitgeest.nl/EE_Test.html
Here's the text:
<HTML>
<HEAD>
<TITLE>Cross-Window Write</TITLE>
<SCRIPT>
newwindow=window.open();
newdocument=newwindow.docu
newdocument.write("<html><
newdocument.write('<!DOCTY
newdocument.write('<title>
newdocument.write('<BASE HREF="http://anwb.tensingsks.com/anwb/" >');
newdocument.write('</HEAD>
newdocument.write('<BODY bgProperties=fixed BACKGROUND="Image3.jpg" onload="window.moveTo(0,0)
newdocument.write('<form name="frm" action="/anwb/scripts/tgig
newdocument.write('<input type="hidden" name="countryid0" value="0">');
newdocument.write('<input type="hidden" name="RMODE" value="FAST">');
newdocument.write('<input type="hidden" name="countryid1" value="0">');
newdocument.write('<input type="hidden" name="pcid0" value="58826">');
newdocument.write('<input type="hidden" name="TEMPLNAME" value="zoek_route_tussen.h
newdocument.write('<input type="hidden" name="REDIRURL" value="http://anwb.tensingsks.com/anwb/scripts/tgigw.dll?APP=ANWBMS&CMD=ROUTE&OUTPUT=HTML&">');
newdocument.write('<input type="hidden" name="app" value="anwbresolve">');
newdocument.write('<input type="hidden" name="cmd" value="resolve1">');
newdocument.write('<input type="hidden" name="pc0" value="1911TR" >');
newdocument.write('<input type="hidden" name="pc1" value="1624AA" >');
newdocument.write('</form>
newdocument.write('</body>
newdocument.write('</html>
newwindow.history.go(0);
// start polling for load finish
//setTimeOut("newwindow.st
</SCRIPT>
</HEAD>
</HTML>
ASKER
Hi CJ,
The site I redirect to (anwb.tensingsks.com) is not mine. I am trying to (mis/re)use this site to supply routeplan information on predefined routes. I'm supplying start and end points.
This site allows my local files to have a piggyback ride, but when the file originates from the internet, it doesn't. If security is the difference, then it has to be about the origin of the html file. Is there a way to impersonate a local file?
WiseGuy
The site I redirect to (anwb.tensingsks.com) is not mine. I am trying to (mis/re)use this site to supply routeplan information on predefined routes. I'm supplying start and end points.
This site allows my local files to have a piggyback ride, but when the file originates from the internet, it doesn't. If security is the difference, then it has to be about the origin of the html file. Is there a way to impersonate a local file?
WiseGuy
That must be it. They must do a check there somehow.
Why not use the direct location and change the postcodes into the correct postcode? (zipcode), and then open it directly.
Something like
zip1 = "1911TR";
zip2 = "1624AA";
window.open("http://anwb.tensingsks.com/anwb/scripts/tgigw.dll?APP=ANWBMS&CMD=ROUTE&OUTPUT=HTML&RMODE=FAST&resseltype0=1&rescountryid0=0&respc0=1911TR&respcid0=58826&resdescr0=postcode+"+zip1+"&resx 0=1479918& resy0=1979 606&ressel type1=1&re scountryid 1=0&respc1 =1624AA&re spcid1=450 78&resdesc r1=postcod e+"+zip2+" &resx1=150 3859&resy1 =1993065") ;
All on one line.
CJ
CJ
Why not use the direct location and change the postcodes into the correct postcode? (zipcode), and then open it directly.
Something like
zip1 = "1911TR";
zip2 = "1624AA";
window.open("http://anwb.tensingsks.com/anwb/scripts/tgigw.dll?APP=ANWBMS&CMD=ROUTE&OUTPUT=HTML&RMODE=FAST&resseltype0=1&rescountryid0=0&respc0=1911TR&respcid0=58826&resdescr0=postcode+"+zip1+"&resx
All on one line.
CJ
CJ
wait. one more ting. in the code posted
WHERE IS THE <BODY>.
All html have got to have a <BODY>.
your script is javascript so here's a correction for your code
<HTML>
<HEAD>
<TITLE>Cross-Window Write</TITLE>
<SCRIPT language="javascript">
function loaded(){
newwindow=window.open();
newdocument=newwindow.docu ment;
newdocument.write("<html>< head>");
newdocument.write('<!DOCTY PE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');
newdocument.write('<title> ANWB Routeplanner</title>');
newdocument.write('<BASE HREF="http://anwb.tensingsks.com/anwb/" >');
newdocument.write('</HEAD> ');
newdocument.write('<BODY bgProperties=fixed BACKGROUND="Image3.jpg" onload="window.moveTo(0,0) ; if (document.all)
{ top.window.resizeTo(screen .availWidt h,screen.a vailHeight )};documen t.frm.acti on.value = 1;document.frm.submit();"> ');
newdocument.write('<form name="frm" action="/anwb/scripts/tgig w.dll" method="post">');
newdocument.write('<input type="hidden" name="countryid0" value="0">');
newdocument.write('<input type="hidden" name="RMODE" value="FAST">');
newdocument.write('<input type="hidden" name="countryid1" value="0">');
newdocument.write('<input type="hidden" name="pcid0" value="58826">');
newdocument.write('<input type="hidden" name="TEMPLNAME" value="zoek_route_tussen.h tt">');
newdocument.write('<input type="hidden" name="REDIRURL" value="http://anwb.tensingsks.com/anwb/scripts/tgigw.dll?APP=ANWBMS&CMD=ROUTE&OUTPUT=HTML&">');
newdocument.write('<input type="hidden" name="app" value="anwbresolve">');
newdocument.write('<input type="hidden" name="cmd" value="resolve1">');
newdocument.write('<input type="hidden" name="pc0" value="1911TR" >');
newdocument.write('<input type="hidden" name="pc1" value="1624AA" >');
newdocument.write('</form> ');
newdocument.write('</body> ');
newdocument.write('</html> ');
newwindow.history.go(0);
// start polling for load finish
//setTimeOut("newwindow.st op()",2500 );
}
</SCRIPT>
</HEAD>
<body onload="loaded()">
</body>
</HTML>
does this work?
lhn.
WHERE IS THE <BODY>.
All html have got to have a <BODY>.
your script is javascript so here's a correction for your code
<HTML>
<HEAD>
<TITLE>Cross-Window Write</TITLE>
<SCRIPT language="javascript">
function loaded(){
newwindow=window.open();
newdocument=newwindow.docu
newdocument.write("<html><
newdocument.write('<!DOCTY
newdocument.write('<title>
newdocument.write('<BASE HREF="http://anwb.tensingsks.com/anwb/" >');
newdocument.write('</HEAD>
newdocument.write('<BODY bgProperties=fixed BACKGROUND="Image3.jpg" onload="window.moveTo(0,0)
{ top.window.resizeTo(screen
newdocument.write('<form name="frm" action="/anwb/scripts/tgig
newdocument.write('<input type="hidden" name="countryid0" value="0">');
newdocument.write('<input type="hidden" name="RMODE" value="FAST">');
newdocument.write('<input type="hidden" name="countryid1" value="0">');
newdocument.write('<input type="hidden" name="pcid0" value="58826">');
newdocument.write('<input type="hidden" name="TEMPLNAME" value="zoek_route_tussen.h
newdocument.write('<input type="hidden" name="REDIRURL" value="http://anwb.tensingsks.com/anwb/scripts/tgigw.dll?APP=ANWBMS&CMD=ROUTE&OUTPUT=HTML&">');
newdocument.write('<input type="hidden" name="app" value="anwbresolve">');
newdocument.write('<input type="hidden" name="cmd" value="resolve1">');
newdocument.write('<input type="hidden" name="pc0" value="1911TR" >');
newdocument.write('<input type="hidden" name="pc1" value="1624AA" >');
newdocument.write('</form>
newdocument.write('</body>
newdocument.write('</html>
newwindow.history.go(0);
// start polling for load finish
//setTimeOut("newwindow.st
}
</SCRIPT>
</HEAD>
<body onload="loaded()">
</body>
</HTML>
does this work?
lhn.
what i have done is put your script in a function.
and then i asked the browser to load the function. so it'll work as well as your original script.
lhn.
and then i asked the browser to load the function. so it'll work as well as your original script.
lhn.
ASKER
Hi CJ,
Well you comment with the direct window.open(...) worked, so could you post an answer please.
Thanx for the support
WiseGuy
Well you comment with the direct window.open(...) worked, so could you post an answer please.
Thanx for the support
WiseGuy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good work!
Both an answer to the question and a solution for the underlying problem.
CU, WiseGuy
Both an answer to the question and a solution for the underlying problem.
CU, WiseGuy
When I open your online page it redirects to a virtual directory "http://anwb.tensingsks.com/anwb/scripts/", this directory does not allow contents to be listed.
You submit the form and go to a dll (ISAPI I assume). For this to work the internet user will need sufficient rights to access this dll. If you work locally you are running under the logged in account (administrator or someone else), but not with the IUSR_MACHINENAME user.
Go to IIS and check the following:
1) the scripts directory allows "Scripts and executables"
2) The IUSR_MACHINENAME may access the site
3) integrated windows authentication is turned off.
CJ