...

View Full Version : Why is it printing '[Object]'?



Dalal
02-11-2007, 01:53 AM
To explain my problem very briefly: I use document.write to print a string variable containing a string. The output I get is:


[object]

What is that supposed to mean? Has anyone else encountered such a problem before? How did you fix it?

Thanks,
Dalal

chump2877
02-11-2007, 01:57 AM
It means your string isn;t a string, it's an object...try this code and see what it outputs:


alert(string.toSource());



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum