Solved

innerHTML of frame with an FTP location?

Posted on 2002-04-24
11
408 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
  • 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Angular JS question 24 39
Auto Submit on dropdown box 14 32
es6 typescript how to filter an array 10 39
angularls and plnkr 14 19
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now