Solved

What's the big difference between local html and downloaded html

Posted on 2002-03-19
8
180 Views
Last Modified: 2010-04-09
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.document;
newdocument.write("<html><head>");
newdocument.write('<!DOCTYPE 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.availWidth,screen.availHeight)};document.frm.action.value = 1;document.frm.submit();">');
newdocument.write('<form name="frm" action="/anwb/scripts/tgigw.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.htt">');
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.stop()",2500);
</SCRIPT>
</HEAD>
</HTML>
0
Comment
Question by:WiseGuy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 6879504
The difference is security. Locally you can do everything: creating and using components, adjust local items etc. Online you cannot.

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
0
 
LVL 1

Author Comment

by:WiseGuy
ID: 6879591
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
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6879634
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+"&resx0=1479918&resy0=1979606&resseltype1=1&rescountryid1=0&respc1=1624AA&respcid1=45078&resdescr1=postcode+"+zip2+"&resx1=1503859&resy1=1993065");

All on one line.

CJ


CJ
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:lexxwern
ID: 6879642
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.document;
newdocument.write("<html><head>");
newdocument.write('<!DOCTYPE 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.availWidth,screen.availHeight)};document.frm.action.value = 1;document.frm.submit();">');
newdocument.write('<form name="frm" action="/anwb/scripts/tgigw.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.htt">');
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.stop()",2500);
}
</SCRIPT>
</HEAD>
<body onload="loaded()">
</body>
</HTML>

does this work?


lhn.
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6879647
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.
0
 
LVL 1

Author Comment

by:WiseGuy
ID: 6893526
Hi CJ,

Well you comment with the direct window.open(...) worked, so could you post an answer please.

Thanx for the support

WiseGuy
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 200 total points
ID: 6893538
Glad to help!

CJ
0
 
LVL 1

Author Comment

by:WiseGuy
ID: 6893589
Good work!

Both an answer to the question and a solution for the underlying problem.

CU, WiseGuy
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to create a slidershow with the use of the property cover in css 15 65
ASP.net Markup for Sub Menu 2 42
Ajax on ASP 2 36
HTML editor custom button 3 58
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question