variable in function - syntax

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

    variable in function - syntax

    Hi

    I know only little of javascript and have trouble with the syntax of a
    function

    this is the function

    function ClipBoard( VARIABLE)
    {
    holdVARIABLE.in nerText = VARIABLE.innerT ext;
    Copied = holdVARIABLE.cr eateTextRange() ;
    Copied.execComm and("Copy");
    }

    probably needless to say, but it doesn't work.
    How can i get this function to work?

    thanks in advance,

    Marnix
  • Gill Bates

    #2
    Re: variable in function - syntax

    Looks like JScript to me, which is of course only similar to JavaScript or
    EcmaScript.
    Look at the JScript pages from MS if you really want to do this.

    It would be handy to tell what you want the function to do.


    "Marnix" <none@none.co m> wrote in message
    news:MPG.199089 0bf36c0b5598968 a@news.xs4all.n l...[color=blue]
    > Hi
    >
    > I know only little of javascript and have trouble with the syntax of a
    > function
    >
    > this is the function
    >
    > function ClipBoard( VARIABLE)
    > {
    > holdVARIABLE.in nerText = VARIABLE.innerT ext;
    > Copied = holdVARIABLE.cr eateTextRange() ;
    > Copied.execComm and("Copy");
    > }
    >
    > probably needless to say, but it doesn't work.
    > How can i get this function to work?
    >
    > thanks in advance,
    >
    > Marnix[/color]


    Comment

    • DU

      #3
      Re: variable in function - syntax

      Marnix wrote:[color=blue]
      > Hi
      >
      > I know only little of javascript and have trouble with the syntax of a
      > function
      >[/color]

      Maybe you're a newbie but you have at least one good coding technique:
      you try to give meaningful, intuitive, self-explanatory identifiers to
      your variables. And that helps debugging, review by others and code
      reusability, etc..
      [color=blue]
      > this is the function
      >
      > function ClipBoard( VARIABLE)
      > {
      > holdVARIABLE.in nerText = VARIABLE.innerT ext;
      > Copied = holdVARIABLE.cr eateTextRange() ;
      > Copied.execComm and("Copy");
      > }
      >
      > probably needless to say, but it doesn't work.
      > How can i get this function to work?
      >
      > thanks in advance,
      >
      > Marnix[/color]

      What do you want to do exactly? Let me guess. You want your
      visitors/users to be able to somehow copy and store highlighted/selected
      text from some place in your webpage?

      Right now, your code only uses proprietary MSIE methods and properties.

      Please describe your webpage situation, context, requirements, what you
      want to do, et.. Best is to give an url along with your brief and
      straightforward descriptions. Most people here will be able to figure
      out the rest... unless you need to answer a few more questions.

      DU
      --
      Javascript and Browser bugs:

      - Resources, help and tips for Netscape 7.x users and Composer
      - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


      Comment

      • Marnix

        #4
        Re: variable in function - syntax

        In article <bg5u56$252$1@n ews.eusc.inter. net>,
        drunclear@hotRE MOVEmail.com says...[color=blue]
        > Maybe you're a newbie but you have at least one good coding technique:
        > you try to give meaningful, intuitive, self-explanatory identifiers to
        > your variables. And that helps debugging, review by others and code
        > reusability, etc..[/color]

        not really my product. I got it from this url

        i want to adjust the script to my sitution, but with my knowledge of js
        it goes a little over my head.
        [color=blue]
        > What do you want to do exactly? Let me guess. You want your
        > visitors/users to be able to somehow copy and store highlighted/selected
        > text from some place in your webpage?
        > Right now, your code only uses proprietary MSIE methods and properties.[/color]

        You are right. Images in a certain directory are listed. After clicking
        the reference to the picture is copied to the clipboard and can be used
        in a wysiwyg-editor.
        Right again about the MSIE prop. Yet this isn't a problem, because the
        site has a wysiwyg-editor which is MSIE only.

        [color=blue]
        > Please describe your webpage situation, context, requirements, what you
        > want to do, et.. Best is to give an url along with your brief and
        > straightforward descriptions. Most people here will be able to figure
        > out the rest... unless you need to answer a few more questions.[/color]

        Images reside in a dir. This dir is listed on the site. Each image gets
        a button "copy to clipboard". The text that must be copied to the
        clipboard = /dirname/imagename
        the site is protected by .htaccess, so i made an user "test".
        http://test:test@www.sarnix.nl/ts/cms/images.php

        thanks for your answers DU and Gill Bates.
        I hope you're willing to take another look at it. thanks in advance.

        Marnix

        Comment

        Working...