List Info

Thread: opera and javascript debugging




opera and javascript debugging
user name
2006-04-01 16:19:39
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hallo,

is it possible to add some commands to javascript, so that
it outputs the content of arrays into the
javascript-console?
something like
dump(array);
I know how to output single variables, but I don't see how
to do that with arrays.

thanks for input .-)

- --
regards,
 Jurgen

http://www.theregister.co.uk/2004/05/24/us_security_f
iasco/

Using The Bat! v3.72.04 (Beta)
  Opera v8.53.7722 on WinXP Home v2600 SP2

* PGP key available on request: send mail with subject PGP
key request
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)

iD8DBQFELqgcoXyU9LPZSMERAv7OAJ42b+lfAMY01zxeGRZ4ebieIPU8EQCf
aghw
7OyfGzmPSsLSqJzu/DtTcRk=
=zirM
-----END PGP SIGNATURE-----


-- 
Unsubscribe: mailto:opera-users-requestopera.com?subject=unsubscribe
opera and javascript debugging
user name
2006-04-06 22:51:15
On 1 Apr 2006 at 18:19, Jurgen Haug wrote:

> is it possible to add some commands to javascript, so
that it outputs the
> content of arrays into the javascript-console?
something like dump(array);
> I know how to output single variables, but I don't see
how to do that with
> arrays.

Hello Jurgen,
I'm a bit late so perhaps you've realised already but..

1) Normal arrays will print out as a comma-separated list of
values 
if you just do 

opera.postError(array)

2) Objects (with name=>value like other languages
sometimes call 
associative arrays) can be "inspected" with some
simple for..in 
tricks.


function objinspect(obj){var s='';for(var e in 
obj)s+=e+':'+obj[e]+'\n';opera.postError(s);}

objinspect(object)

Hope this helps.
-- 
Hallvord Reiar Michaelsen Steen
hallvordhallvord.com  http://www.hallvord.com/

Assuming that communication is possible is more fun

-- 
Unsubscribe: mailto:opera-users-requestopera.com?subject=unsubscribe
opera and javascript debugging
user name
2006-04-07 05:01:18
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Hallvord,

Friday, April 7, 2006, 12:51:15 AM, you wrote:



> 1) Normal arrays will print out as a comma-separated
list of values
> if you just do

> opera.postError(array)

> 2) Objects (with name=>value like other languages
sometimes call
> associative arrays) can be "inspected" with
some simple for..in
> tricks.


> function objinspect(obj){var s='';for(var e in
> obj)s+=e+':'+obj[e]+'\n';opera.postError(s);}

> objinspect(object)

> Hope this helps.

thank you, yes it helps . I didn't
find out about the second option.  Have to save that.



- --
Best regards,
 Jurgen

"Housework is so wonderfully patient that it waits for
you no matter HOW long you put if off."

Using The Bat! v3.72.04 (Beta)
  Opera v8.53.7722 on WinXP Home v2600 SP2

* PGP key available on request: send mail with subject PGP
key request
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)

iD8DBQFENfIkoXyU9LPZSMERAgvJAJ9Uu816gS53lVOgCDmIew21bZfmhwCf
UMwz
k/dsIw2DGEtsQaBrYcln57g=
=XMT2
-----END PGP SIGNATURE-----


-- 
Unsubscribe: mailto:opera-users-requestopera.com?subject=unsubscribe
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )