Geeks With Blogs
Scott Van Vliet Once a Developer, Always a Developer Javascript
Simple Javascript Object Dump Function
In my years of doing Web development, I've written this function several times over; however, I can NEVER find the code when I need it! Thus, here is a simple Javascript function to dump the contents of any object (posted to share, but also for my own permanent reference!) <script language="javascript"> var MAX_DUMP_DEPTH = 10; function dumpObj(obj, name, indent, depth) { if (depth > MAX_DUMP_DEPTH) { return indent + name + ": <Maximum Depth Reached>\n"; } if (typeof obj == "object") ......

Posted On Thursday, March 23, 2006 6:04 PM

TextArea Cursor Position with JavaScript
I’d recently searched around for some good-quality JavaScript snippets to determine the cursor position within an HTML TextArea, but haven’t had any luck. So, like any fellow geek would do, I came up with my own solution. The DOM in IE does not provide information regarding relative position in terms of characters; however, it does provide bounding and offset values for browser-rendered controls. Thus, I used these values to determine the relative bounds of a character. Then, using the JavaScript ......

Posted On Thursday, March 24, 2005 10:31 PM

Copyright © svanvliet | Powered by: