Solved

innerHTML of frame with an FTP location?

Posted on 2002-04-24
11
413 Views
Last Modified: 2008-03-10
I need to access the "document.body.innerHTML" of a frame when the frame location is an ftp site.

I can do it as long as the location of the frame is an http page, but when I make it an ftp site, the frame no longer has a "document" object.

Here is the code that is giving me problems:

** Main Frameset Page **
<html>
<head>
<script language="javascript">
<!--
function logon(user,pw,server) {
  bottomframe.location = 'ftp://' + user + ':' + pw + '@' + server;
  return;
}
function check() {
  alert(bottomframe.document.body.innerHTML);
}
//-->
</script>
</head>

<frameset name="frameset" rows="*,100">
  <frame name="topframe" src="logon.html">
  <frame name="bottomframe" src="blank.html">
</frameset>


** logon.html Page **
<html>
<head>
</head>
<body>
<form name="logonForm" action="SelectPage.html">
<b>Logon to Web Site</b>
<br>
Username:<input name="username" type="text">
<br>
password:<input name="password" type="password">
<br>
Web Server:<input name="server" type="text">
<br>
<input type="button" value="Logon" onClick="parent.logon(document.logonForm.username.value,document.logonForm.password.value,document.logonForm.server.value);">
<br>
<input type="button" value="Show innerHTML" onClick="parent.check();">
</form>
</body>
</html>

** blank.html Page **
<html>
<head>
</head>
<body>
The innerHTML is here
</body>
</html>
0
Comment
Question by:garthmiller
[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
  • +2
11 Comments
 
LVL 30

Expert Comment

by:third
ID: 6967956

"I can do it as long as the location of the frame is an http page"

not all http page but only pages that you own or pages that grants you full access. try setting the bottom frame to www.yahoo.com and see what i mean.

this also applies to your problem.
0
 
LVL 1

Expert Comment

by:stevenmoffat
ID: 6967957
Ive read through the script

Can you give broad outline of what you are trying to acheive??

Im assuming you want authorised users the ability to download certain files????

steven M
0
 

Author Comment

by:garthmiller
ID: 6968311
third:

You are right (although the error message for pages that I don't own says "access denied" instead of "no such interface supported" which is what it says for ftp pages).

steven M:

You are right, I want to make an HTML editor using javascript.  This means I need the browser to be able to upload and download files.
0
Industry Leaders: 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 1

Expert Comment

by:stevenmoffat
ID: 6968344
www.spidergen.com

cost about uk £250 for studio version and £100 for normal client, this does what you want to do here

unless this is a project and you want to compete with these guys, or have other restrictions

i figure a days work compared to offshelve solution good odds

stevenM
0
 
LVL 30

Expert Comment

by:third
ID: 6970228
"no such interface supported"

therefore these statement generally means that accessing documents from http to ftp is not supported by browsers although http can view the page but is on a protected mode (i.e. readonly).

for creating javascript-based HTML editor, you will find this link very useful,

http://www.javascript-page.com/easyhtml/
0
 

Author Comment

by:garthmiller
ID: 6970280
I've discovered a way to get the contents of a file from a web server using javascript.  Here is what my new logon function looks like.

function logon(user,pw,server) {
  // the user and pw variables are not needed
  // because this uses HTTP instead of FTP,
  // the server variable can contain a complete URL.
  var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  xmlHttp.open("GET", server, false);
  xmlHttp.send();
  bottomframe.document.body.innerHTML=xmlHttp.responseText;
 return;
}
0
 
LVL 1

Expert Comment

by:stevenmoffat
ID: 6970970
is the source file you are altering under your control??? ie can it always be xml ??
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8131779
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or so. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
 
ahosang
0
 

Author Comment

by:garthmiller
ID: 8145025
ahosang:

I never got any help with this.  Make whatever recommendation you think best.

0
 
LVL 12

Expert Comment

by:ahosang
ID: 8240105
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 8303750
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

734 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