Posts tagged javascript

JSON native object

Why did it take me so long to find the docs on the native JSON object? Too many blog posts on other implementations of JSON and JSONP with third-party libraries (I still love you, jQuery). https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON IE 7 doesn’t support it… I’ll have to check my analytics and see if that even matters anymore…

Convert number to binary in Javascript

Why did it take me so long to find this? Probably because I didn’t use radix in my Google search. Of course. Thanks to “Philip M” for the clue and thanks to W3Schools.com for the reference (see here for more on the unary “+” operator to convert a string to number). var str = ’37′; [...]

Pass (isolate) a value, not variable, in Javascript

I found an article detailing some “oddities” in Javascript today. The callback argument in the replace method was new for me, though I feel that there must be some eccentric behavior that pushed this “secret” into the shadows. Number 7 proved the most beneficial for me. My attempts to pass the current value of a [...]

JSON content type in classic ASP

I spent a considerable portion of my morning yesterday trying to get my classic ASP to serve up JSON to an application I’m working on. Finally, I found a subtle difference in the “Response.ContentType” property and “Response.AddHeader()” method (I code in JavaScript, btw). I set “Response.ContentType = ‘application/json’” and it always returned a nicely-formatted JSON [...]

Detecting whether a query string parameter is set in classic ASP

In PHP, there’s a fancy little function called “isset()” that allows you to test whether a variable has been set (as opposed to being instantiated or declared).  Classic ASP doesn’t, and I have to relearn how to do it every time.  I code ASP JavaScript, so here’s what I found: var q = Request.QueryString(‘query’) + [...]

Run MS Access Macro with Javascript in HTA

Combined examples from this site and that site to make the following: var oAccess = new ActiveXObject(‘Access.Application’); oAccess.Visible = false; oAccess.OpenCurrentDatabase(‘c:\\path\\database.mdb’); oAccess.DoCmd.RunMacro(‘NameOfMacro’); oAccess.Quit(2); //2 = acQuitSaveNone option for save command oAccess = null;

Ext Js – JavaScript Framework

I stumbled on Ext JS a long time ago, when I was first getting into web apps.  Only now do I really appreciate them, if only as inspiration. http://www.extjs.com/

CSS !important supersedes DHTML changes

Finally, with the help of Firebug and lots of patience, I discovered why my jQuery animation wasn’t working (on a personal project of mine, more on that later…)  Essentially I intended to animate a div from 100px to a calculated height ($(window).document.height()-$(this).height()) but for the life of me, I could not get it to work.  [...]

Google Calendar API – Javascript Example

After all the work I put into creating a server-side script to add events in Google Calendar, it turns out that due to security reasons I have to go the AJAX route.  I should have gone with my gut feeling to do so in the beginning. :/ I created a javascript object for my calendar [...]

jQuery Date/Time Picker

I found a great date/time picker for jQuery today. There are enough date pickers on the net to fill a house, but finding a good time picker has always been a challenge.  The reason is that dates – in the ubiquitous tabular calendar, which happens to be very click-conducive  -  are a familiar sight that [...]