rarebit Posted May 7, 2008 Share Posted May 7, 2008 Hi, I tend not to use javascript too much, but i'm forcing myself go through the motions and writing myself a tutorial section on the subject. What i've done here is to iterate through all the properties (that I know of) and dump them to screen, however not knowing what most of them are and what potential risk they may pose when it comes to XSS and the such like i'm wondering whether it's a good idea to include the script within my CMS? <script language="Javascript" type="text/javascript"> function display_properties(obj, sobj) { document.write(sobj.toUpperCase() + " PROPERTIES<br>=====================<br>"); var property; var desc; for (property in obj) { if(property != 'display_properties') { try { desc = obj[property]; } catch(e) { desc = "ERRROR"; } document.write("The " + property + " of " + sobj + " is: " + desc + "<br>") } } } var names = new Array('window', 'document', 'location', 'History', 'Frame', 'Link', 'Anchor', 'Image', 'Area', 'Applet', 'Event', 'Form', 'Elements', 'Text', 'Textarea', 'Checkbox', 'Submit', 'Reset', 'Select', 'Option', 'Password', 'Hidden', 'FileUpload', 'Navigator', 'Screen', 'Embed', 'MimeType', 'Plugin'); var property; for (property in names) { document.write("<br><br><br>"); try { obj = eval(names[property]); display_properties(obj, names[property]); } catch(e) { document.write(names[property].toUpperCase() + " PROPERTIES<br>=====================<br>UNDEFINED<br>"); } } </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.