JAVASCRIPT opendoc

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ANNON

    JAVASCRIPT opendoc

    I am trying to open an html document on a html page as a text
    variable. So that in a perfect world the code would look like this:

    <SCRIPT LANGUAGE="JavaS cript">
    var test = document.open(" file.html");
    document.write( " " + test + " ");
    </SCRIPT>

    So basically I would be retrieving the text out of that file, and
    using it on the current page I am on a VARIABLE.

    Any help will be apreciated.

    Thanks,
  • kaeli

    #2
    Re: JAVASCRIPT opendoc

    In article <9a147278.04072 61051.3a37537@p osting.google.c om>,
    sethmknorr@yaho o.com enlightened us with...[color=blue]
    > I am trying to open an html document on a html page as a text
    > variable. So that in a perfect world the code would look like this:
    >[/color]

    Not in a client-side javascript in the default security environment, you
    can't.

    Solutions that are either not cross-browser, not stictly client-side script,
    and/or not default security:
    java applet
    server-side script to create a javascript text file from the html file
    ActiveX
    COM
    HTA

    --
    --
    ~kaeli~
    Join the Army, meet interesting people, kill them.



    Comment

    • Colin McKinnon

      #3
      Re: JAVASCRIPT opendoc

      kaeli wrote:
      [color=blue]
      > In article <9a147278.04072 61051.3a37537@p osting.google.c om>,
      > sethmknorr@yaho o.com enlightened us with...[color=green]
      >> I am trying to open an html document on a html page as a text
      >> variable. So that in a perfect world the code would look like this:
      >>[/color]
      >
      > Not in a client-side javascript in the default security environment, you
      > can't.
      >
      > Solutions that are either not cross-browser, not stictly client-side
      > script, and/or not default security:
      > java applet
      > server-side script to create a javascript text file from the html file
      > ActiveX
      > COM
      > HTA
      >[/color]

      Or open it in a frame / iframe.

      C.

      Comment

      • kaeli

        #4
        Re: JAVASCRIPT opendoc

        In article <ce52jc$n4$1$83 02bc10@news.dem on.co.uk>,
        colin.deletethi s@andthis.mms3. com enlightened us with...[color=blue]
        > kaeli wrote:[color=green]
        > > In article <9a147278.04072 61051.3a37537@p osting.google.c om>,
        > > sethmknorr@yaho o.com enlightened us with...[color=darkred]
        > >> I am trying to open an html document on a html page as a text
        > >> variable. So that in a perfect world the code would look like this:[/color]
        > > Not in a client-side javascript in the default security environment, you
        > > can't.
        > > Solutions that are either not cross-browser, not stictly client-side
        > > script, and/or not default security:
        > > java applet
        > > server-side script to create a javascript text file from the html file
        > > ActiveX
        > > COM
        > > HTA
        > >[/color]
        >
        > Or open it in a frame / iframe.
        >[/color]


        That will not work if the content is outside the domain of the opener
        (security error). You can't access the content of a frame from another frame
        if it's in a different domain of the script trying to access it. Even a
        different protocol would throw the error.

        Otherwise it would work in DOM browsers pretty well.

        --
        --
        ~kaeli~
        If that phone was up your a$$, maybe you could drive a
        little better!



        Comment

        Working...