[Greasemonkey] put a text

Carlos Zuniga carlos.zun at gmail.com
Sun Feb 5 03:38:00 EST 2006


Right, thanks how could i have miss that :P

On 2/5/06, Vectorspace <vectorspace at ntlworld.com> wrote:
> Firstly, Greasemonkey scripts are only run after the page has fully loaded.
>
> Secondly, your code is wrong:
> passcode = getcode.value.substring(6,10);
> getcode.value is contents of the value attribute of the UsLogT element,
> but passcode is the variable itself, not the value of the element that
> passcode points to. You need to reference the value in the same way that
> you did for getcode:
> passcode.value = getcode.value.substring(6,10);
>
>
> Carlos Zuniga wrote:
> > Hi, i'm new on the list and a newbie on javascript.
> >
> > I'm trying to put text from an element into a input element but it
> > doesn't do it (in the Javascript Shell i've found in
> > diveintogreasemonkey it works), my code is:
> >
> > var getcode = document.getElementsByName('UsLogT')[0];
> > var passcode = document.getElementsByName('Passcode')[0];
> > passcode = getcode.value.substring(6,10);
> >
> > I guess it's because the page takes some time to load, does
> > greasemonke scripts start after the page is fully loaded? if not how
> > can i make my script start when its loaded?
> >
> > Thanks for the help, GM is really cool.
> >
> > --
> > Linux Registered User # 386081
> > A menudo unas pocas horas de "Prueba y error" podrán ahorrarte minutos
> > de leer manuales.
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>


--
Linux Registered User # 386081
A menudo unas pocas horas de "Prueba y error" podrán ahorrarte minutos
de leer manuales.
カルロス


More information about the Greasemonkey mailing list