Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #28706

Re: Is it possible to reassign js function to an object without including parameter(s)?

Newsgroups comp.lang.javascript
Subject Re: Is it possible to reassign js function to an object without including parameter(s)?
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <40bb4feb-2cbf-4b11-86b5-4f845eee6ca8@googlegroups.com> <06826f8f-55f0-4e86-b031-c34087fc1b02@googlegroups.com>
Date 2015-09-25 09:11 +0200
Message-ID <XnsA5205D7CE7F3Ceejj99@194.109.6.166> (permalink)

Show all headers | View raw


danny <dann90038@gmail.com> wrote on 24 Sep 2015 in comp.lang.javascript:

> to justaguy
> 
> you could simply, use the "arguments" collection to get whatever
>  the 1st argument is, it doesn't have to be a parameter in the "arity",
>  and give that to the event listener
>  -----------------------------------------------
> 
> document.getElementById('me1').onclick = f2;
> document.getElementById('me1').addEventListener("click", f2, false);

Both?

>  function f2(){
>            window.open("myscript.html?"+arguments[0])
>            }

arguments[0] will convert to an empty string every time,
when clicking 'me1', I expect.



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Is it possible to reassign js function to an object without including parameter(s)? justaguy <lichunshen84@gmail.com> - 2015-09-20 07:06 -0700
  Re: Is it possible to reassign js function to an object without including parameter(s)? Martin Honnen <mahotrash@yahoo.de> - 2015-09-20 16:42 +0200
    Re: Is it possible to reassign js function to an object without including parameter(s)? justaguy <lichunshen84@gmail.com> - 2015-09-20 08:58 -0700
  Re: Is it possible to reassign js function to an object without including parameter(s)? danny <dann90038@gmail.com> - 2015-09-24 13:03 -0700
    Re: Is it possible to reassign js function to an object without including parameter(s)? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-25 09:11 +0200

csiph-web