Posts tagged asp

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’) + [...]

Add Google Calendar event with VBScript

With the help of Mr Marco Cioffi, I finally added a Google Calendar event with VBScript.  He posted a great example script (one that I’ve been searching for over the last several days), but his site is in “Maintenance Mode” so I had to access the cached version. This example uses the “MSXML2.ServerXMLHTTP” object, which [...]

CreateObject or new ActiveXObject

It’s been awhile.  I forgot that the following in VBScript set objTest = CreateObject(“MSXML2.ServerXMLHTTP”) is equivalent to the following in JScript var objTest = new ActiveXObject(‘MSXML2.ServerXMLHTTP’); But my question: Why doesn’t the “MSXML2.ServerXMLHTTP” object work in JScript? UPDATE (Feb 09, 2010): I just read the instructions (duh!) and it worked.  I forgot to consider case-sensitive [...]

echo function in ASP

Javascript (actually JScript, whatever): echo = function(x) {return Response.Write(x);} Why didn’t I think of this earlier? Just added this line to my connection file and saved myself 10 keystrokes every time I want to print to screen. The wonders of coding in Notepad.