Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Washington DC
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IDEAS or Solution to Source Code Capture ??

    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>
    Jim Clements

  • #2
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    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.

  • #3
    Registered User
    Join Date
    Aug 2003
    Location
    Wales
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    insert source into text area

    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>
    <IEownload ID="getfile" STYLE="behavior:url(#default#download)">
    <a href="javascript:loaddata('index.html')">source</a>
    <textarea rows=10 cols=50 id="text"></textarea>

    </xmp>

  • #4
    Registered User
    Join Date
    Aug 2003
    Location
    Wales
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    source in textarea

    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>

  • #5
    Regular Coder
    Join Date
    Apr 2003
    Location
    On the W3C and W3schools web sites.
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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:


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •