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 7 of 7

Thread: few source

  1. #1
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts

    few source

    function source()
    {
    location="view-source:" + window.location.href
    }

    this function would few the source in the same window... but how can i tell it to open a new window?

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Use window.open, and send it the same URL as you were writing to the location of the current window.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    but it doesnt work

    function Source(){
    location="view-source:" + window.open.location
    }

    now it doesnt do anything

    then i tried this:

    function Source(){
    location="view-source:" + window.open('MenuV.5.htm').location
    }

    that gives me a blank page
    Last edited by JAVAEOC; 01-10-2004 at 05:46 PM.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    338
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    function Source() {
    window.open('view-source:' + location.href);
    }
    Hope that helps!

    Happy coding!

  • #5
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it doesnt work either

  • #6
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <html>
    <head>
    <title>OLECMDID</title>

    <script>
    function printpr(OLECMDID)
    {
    //var OLECMDID = 10;
    /* OLECMDID values:
    * 6 - print
    * 7 - print preview
    * 8 - page setup (for printing)
    * 1 - open window
    * 4 - Save As
    * 10 - properties
    */
    var PROMPT = 1; // 1 PROMPT & 2 DONT PROMPT USER
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0

    CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(OLECMDID,PROMPT);
    WebBrowser1.outerHTML = "";
    }
    </script>
    </head>
    <body>
    <form name="form">
    <select name="olecmdid">
    <option value="6">print
    <option value="7">print preview
    <option value="8">Page Setup for printing
    <option value="1">Open File
    <option value="4">Save this web page as....
    <option value="10">View the properties of this file
    </select>
    <input type="Button" value="Go" onclick="printpr(document.form.olecmdid.value);">
    </form>
    </body>
    </html>

    cool script that thing above... it can do everything i want but it only works in IE, is it possible to do all these things in mozilla + few source in a new window, cause that still dosnt work

    thanks for any help

  • #7
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    more cool stuff : http://msdn.microsoft.com/library/de...n_a2z_22sk.asp

    again is that also possible in mozilla?


  •  

    Posting Permissions

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