...

View Full Version : IDEAS or Solution to Source Code Capture ??



JimClements
10-22-2002, 09:19 PM
Anyone have IDEAS or SOLUTION ?

I have a funtion that will return the source code
of a location ... like a HREF ref or a file location
on a hard drive.

When called it will write the source code to a new
window .. typically the default editor's window...
in my case that is NOTEPAD.

I want to redirect this code to a textarea or variable
on the page that calls the function.

or if not possible .... then a way to read and retrieve
the contents of the open NOTEPAD window that contains
the source code of the supplied reference.

Any GREAT Ideas would be appreciated. I have racked my
brain and read HTML and javascript references till I am
crosseyed.

HELP !! THANKS -- Jim


Here is the code :

// ***********************************************
// AUTHOR: WWW.CGISCRIPT.NET, LLC
// URL: http://www.cgiscript.net
// Use the script, just leave this message intact.
// Download your FREE CGI/Perl Scripts today!
// ( http://www.cgiscript.net/scripts.htm )
// ***********************************************
function viewSource() {
var test = document.txtHtml.source1.value;
document.location = "view-source:" + test;
}
// ***********************************************

This is the FORM and button i use to call the function :

<form name="txtHtml">
<input type="text" name="source1" value="http://www.any.webpage">
<input type="button" onClick="viewSource()" value="View Source">
</form>

bacterozoid
10-22-2002, 10:23 PM
Hmm, I wouldn't know how to go about doing it, I might be able to come up with something, but I think you would need to use something like document.write() to accomplish that. I'll look at your code and see if I can't get that to happen.

stunix
08-16-2003, 07:48 PM
why not try the default download for ie, the known issues (my me) is that it only works inInternet explorer, via http, therefore it wont pull local documents without a localhost.

<xmp>


<html>
<head>
<script type="text/javascript">
<!--
function loaddata(fil){getfile.startDownload(fil,displaydata)}
function displaydata(data){text.value=data;}//alert(data);
// -->
</script>
</head>
<body>
<IE:Download ID="getfile" STYLE="behavior:url(#default#download)">
<a href="javascript:loaddata('index.html')">source</a>
<textarea rows=10 cols=50 id="text"></textarea>

</xmp>

stunix
08-16-2003, 07:51 PM
emoticons make me emotional



<html>
<head>
<script type="text/javascript">
<!--
function loaddata(fil){getfile.startDownload(fil,displaydata)}
function displaydata(data){text.value=data;}//alert(data);
// -->
</script>
</head>
<body>
<IE: Download ID="getfile" STYLE="behavior:url(#default#download)">
<a href="javascript:loaddata('index.html')">source</a>
<textarea rows=10 cols=50 id="text"></textarea>

theabyss
08-16-2003, 08:10 PM
All you had to do was select the box that says "Disable Smilies in This Post" before posting.

Here's an example of it in action:

:) :( :o :D ;) :p :cool: :rolleyes: :mad: :eek: :confused: :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum