ajaxed - free classic ASP Ajax Library (VBScript)

  • Do you think classic ASP is old and not up to date?
  • Do you think there is no recent development done anymore with classic ASP?
  • Do you think recent technologies like Ajax are a mission to implement within classic ASP?

That is all not completely true. Read on…

DEMO: Adding up two numbers, Simple RSS reading

The ajaxed Library comes up with an unique Ajax technique which can be used within your classic ASP applications. You will be able to create Rich Web Applications with not much effort.

The magic behind ajaxed: ajaxed lets you call server side VBScript code directly from client side. In other words it means that you are able to bind e.g. an click event of a button directly to a server side function.

You call a server side function and the functions return value(s) are passed to a JavaScript functions. Thats it!

  • Easy installation in less than 3 minutes
  • Short learning curve (about 20 minutes)
  • Uses one of the most popular JavaScript Libraries: Prototype
  • Object Oriented (OO) Approach
  • Works with Internet Explorer and Mozilla Firefox (the only tested yet)
  • No low level Ajax skills required
  • Includes a complete ASP JSON generator. This is useful if you are using other JavaScript libraries such as EXT or script.aculo.us
  • Additionally it includes a handful of useful and conventient server side functions which are needed in everyday ASP development
  • It includes a lot additional & useful ASP functionality
  • Free for use (LGPL license)

Download latest version:

Edge version (at google code):

  • directly from svn. (with this version you usually get the latest updates. so you should now what you do. things can be untested, etc.)
  • Want help developing ajaxed and commit changes? write me!
Google Groups
Disussion (problems, suggestions, …)
visit ajaxed discussion group

Similar library in PHP: xajax

61 Responses to “ajaxed - free classic ASP Ajax Library (VBScript)”

  1. Elmo says...

    The ASP framework is stille one of the most used ways of creating dynamically working websites. So thank you for this option.
    Not everything on the Internet has to be done useing at big canon (.NET).

     
  2. ajax says...

    good framework.. see this review http://www.ajaxprojects.com/ajax/projects/_NET_Frameworks/Ajaxed_Library.php

     
  3. ariel says...

    can you provide more complex example, currently i develop a web base data management and i want to put ajax method in it, and i think ajaxed is a good option but since am newbie its hard to modify the first example to meet my need. thanks

     
  4. Michal says...

    @ariel: I dont really know exactly what you want to achieve. please give me detailed information about your requirements and i will check if i have the time to come up with an example.

     
  5. ariel says...

    thanks for your quick reply, let assume i have a product table with 2 fields id & name, and a page that consist of 3 button (new,list,delete) and a div with list of products.

    new button will replace the list of products with the form to add new product, and after save back to list products.

    list button will list the product and delete button will delete selected item(s) and return to list products

    thanks again

     
  6. vivek says...

    I want to use ajax tecnology in my classic ASP pages,as i was not much aware of the extra libraries which need to be installed i just developed a page in ajax and uploaded it on the testing server,the problem is that readystate is always==0 and the xmlhttp.open(”get”,url,true) can not be called,in nutshell i just want to ask that what could be the problem and what i need to let the ajax code run on server.
    THANKS

     
  7. TonyMak says...

    Question, I just tested the “adding up two numbers” demo on my iPhone and the result is always 0 (zero).
    The demo worked fine in Safari, and FireFox, but not mobile safari.

    do you know of any thing that may need to be changed for use with an iPhone in the library?

    I haven’t dug through the code yet but thought i’d shoot a quick question in case you’ve already run into it.

    Also the RSS reader demo throws an error on the iPhone as well, it’s however in German I think and i can’t understand it but it goes like this:
    Javascript:
    [ “root”:{Laufzeitfehler in Microsoft VBScript - Fehler ‘800z01a8′ Objekt erforderlich: ‘lib’ /RSS/RSS.asp, line 411

    again that’s only so far on an iPhone.

     
  8. Tristan says...

    Nice framework. One annoying issue though, a lot of the variables are undefined. To reproduce, add “Option Explicit” at the top of the “test.asp” page. Our applications use Options Explicit and so we’ve had to dim all the variables to be able to use the library. This will make updating to a newer version a little difficult.

    Are you able to define all the variables in the next release?

     
  9. Tristan says...

    Something else that is bugging me. Where to put HTML tags like head and their corresponding closing tags?

    Perhaps a change to the draw function would eliminate the problem like so:

    response.clear()
    writeln(”{ “”root”": {”)

    response.flush()
    response.end()

    Thoughts?

     
  10. michal says...

    @tristan: yeah i discovered the thing with the html, head and body tags. I am working on solution for this … now it is not really easy to integrate it without touching the source code of the library … any ideas?

    your idea with the response.clear() and response.end() is interesting.. i have to try it.

     
  11. Jake says...

    I make some changes to the ajaxed/class_AjaxedPage/ajaxed.js file to make it run on jquery libary.
    download it from here if you are interested.
    http://ajaxed-jquery-edition.googlecode.com/files/ajaxed.js

     
  12. Uri says...

    That’s great Jake, I just started exploring Jquery and now i see your post here. No doubt, great timing :)

    Thanks Jake!

     
  13. Casey says...

    Thanks for what appears to be some great code Michael. Do you have the demo for the string functions still available somewhere?

    Thanks!

     
  14. Marcwolf says...

    Hi Guys.
    Many thansk for creating such a useful library. Being a ASP developer from the days of Denali and with a large number of legacy projects behind me I was looking for ways to make some of them AJAXed.
    About 2 years ago I was already working with hidden iframes and server-side callback but AJAX makes it so much simpler.

    Also thanks for an ASP - JASON library. this has always been one of the sticking point re using 3rd party AJAX libraries… and VBScript is a pain with it One Varient Fits All concept.

    Again thanks….

    Da Wuff!!!

     
  15. Sebastian Gomez Morales says...

    it’s good… no, it’s great… no, it’s genius!!!
    thanks a lot for this… i tought i was alone in the world and all the classic ASP devs were dead or turn into zombies or something…

     
  16. Michal says...

    new version is here … supports the new prototype 1.6 and more..

     
  17. chazzuka says...

    @Sebastian Gomez Morales
    no you are not the only one :), if we ask Mr. Bill “Lord of Micro$oft” Gates to put ASP 3.0 as Open Source, will he do that? he will be the real santa claus …

     
  18. veiny says...

    Microsoft VBScript ԋАʱ?펳 ‘800a01b6′

    ?ԏ󲻖??ִˊ?򷽷?: ‘codePage’

    \wwwroot\ajaxed\class_ajaxedPage\ajaxedPage.asp, line 318

    why??????

     
  19. veiny says...

    2 in./ajaxed/demo/default.asp,please look at this picture

    http://hiphotos.baidu.com/v23502388/pic/item/0c9f5c669376d52aab184cb5.jpg

    or

    http://hi.baidu.com/v23502388/blog/item/17565782d8bd97a60cf4d215.html

     
  20. CC says...

    glitch in stringOperations.asp
    public function JSEncode(byVal val)
    val = val & “”
    tmp = replace(val, chr(39), “\’”)
    tmp = replace(tmp, chr(92), “\\”)
    ‘tmp = replace(val, chr(39), “\’”) the order is not correct
    tmp = replace(tmp, chr(34), “"”)
    tmp = replace(tmp, chr(13), “”)
    tmp = replace(tmp, chr(10), ” “)
    JSEncode = tmp
    end function

     
  21. CC says...

    another comment on StringOperations
    public function getHiddenInput(name, value)
    getHiddenInput = “”
    end function

    better follow the XHTML way to use “hidden” instead of “Hidden”

     
  22. rolphes says...

    I’ve seen that the documentation for the Ajaxed Library was created with the GabLibrary Documentor. Is this tool shared with the Gab Library and is it free to document self written classes?

     
  23. Michal says...

    rolphes this documenter hasnt been released to public yet .. but i am planning to do so if i have time …

     
  24. rolphes says...

    I would really appreciate it if you could find some time to release this tool.

    BTW: I like ajaxed a lot. Thanks for your god work!

     
  25. Nakirema says...

    I upload the ajaxed directory to my wwwroot, going to “http://localhost/ajaxed/demo/” will display the form but i get a javascript error.. saying ajaxed is not defined.. Is there something I need to configure on my server?

    Thanks

     
  26. Nakirema says...

    Nevermind… found it… gotta mess the config file..

    Thanks anyway

     
  27. Michal says...

    rolphes i will do my best to come up with it soon

     
  28. Fred says...

    Nice work. I’m sure the 20mins learning curve is true for most, especially if you read the tutorials. I didn’t and had hours of fun trying to get things working ;)

    Just to re-ask a question originally by Tristan in July last year - where do the HTML head, meta, etc tags go? I have tried inside and outside the main() sub and ajaxed doesn’t work (outside) or they are ignored (inside) :(

     
  29. Michal says...

    fred thanks for your nice feedback .. good to see that ppl are using it. i have already a new version which has the problem solved with HEAD, etc. will release it soon.

     
  30. Michal says...

    for all of you who want to stay on the edge of the development .. i have created a google project for ajaxed and the source is controled by svn … so you can always get the latest changes..
    check it here: http://code.google.com/p/asp-ajaxed/
    the version in the trunk is fully functioning and contains already the header and footer solution. see the changes.txt there for more details.

     
  31. Fred says...

    That is just excellent! Thanks for all the hard work on this library - I’ll be checking it out tomorrow.

    I’m still having issues, but that’s down to my complete lack of any Java/JavaScript experience and not a problem with ajaxed ;)

     
  32. Michal says...

    fred try to use my new discussion group at http://groups.google.com/group/asp-ajaxed
    describe your problem detailed there.

     
  33. dotorl says...

    goodd

     
  34. Andrew says...

    HI
    This looks like a great oppotunity to incrementally add Ajax updates to existing application pages. I hit a few problems regarding global vbscript variables on existing pages . Worked around this but wanted to make sure that I am correct in thinking that any server side vbscript code that is left outside of the init() callback() and main() subs will only be run when doing a traditional load of the page.

    So when perfroming an ajaxed call back is ONLY the call back function run , or will any VBscript not contained within a sub or function also be run ?

    My existing code has a large chunk of in line script that is currently setting up globals that are referenced within subs and functions ( sounds bad but these subs are building HTML strings so style options etc it makes sense) , and processing various form actions on a traditional submit.

    I am currently leaving this at the top of the page before declaring the ajaxedPage calback and init functions. Intending over time to move these actions into functions to be called via ajaxed. It seems to be working but would like to know that I am not setting myself up for future problems by false assumptions about what is really happening.

    Thanks
    Drew

     
  35. Michal says...

    andrew its perfect for integrating new functionality into old apps .. its not a problem if you have code which will be run before … if you put code outside the main, init and callback it will be run before (if its situated before)

    i recommend you to get the latest version directly from SVN .. there are some new updates. especially header and footer support

     
  36. Andrew says...

    Thanksfor the quick response, just to clarify , what i run on ajaxed.callback ? JUST the callback function ?

    Thanks

     
  37. Michal says...

    first init sub is called and then callback sub .. thats all

     
  38. Andrew says...

    Great - otherwise it was going to get very complicated !!!!!!

     
  39. Andrew says...

    Am I missing something here ?

    I am trying to load a large select list immediately after the page loads.

    it seems to be working fine in Firefox, and kinda / sorta in IE. Th edifference being that in IE the browser freezes for the length of time that the callback response hadling function is running .

    The actual call back is happenning fine, however with this long list the time to insert the options is fairly large and the freezing is very notcable,

    Could it be that I am calling the ajaxed.callback function directly from the existing pageloaded function rather than directly from an event handler ? and work arounds for this ?

    Thanks
    Andrew

     
  40. Michal says...

    andrew try to call it after the page has been loaded

     
  41. Andrew says...

    not quite sure what you mean as I think that is what I am doing.

    Currently have
    ____________________________
    function gotvendors(recs) {
    var vid = $(”vendorid”).value;
    for ( i=0; i < recs.length; i++) {
    var op = new Option(recs[i].vname, recs[i].vendorid, false,recs[i].vendorid == vid)
    $(”ctrl_vendorid”).options[$(”ctrl_vendorid”).options.length] = op
    }
    }

    function pageloaded () {

    blah blah

    ajaxed.callback(”loadvendordropdown”,gotvendors)
    }

    ——————
    also tried

    var res = ajaxed.callback(”loadvendordropdown”,gotvendors)

    and

    ajaxed.callback(”loadvendordropdown”,function(recs) {

    var vid = $(”vendorid”).value;

    for ( i=0; i < recs.length; i++) {

    var op = new Option(recs[i].vname, recs[i].vendorid, false,recs[i].vendorid == vid)
    $(”ctrl_vendorid”).options[$(”ctrl_vendorid”).options.length] = op
    }
    } )

    is this not what you mean by calling after the page has loaded ?

    Thanks for your help

    Andrew

     
  42. Michal says...

    andrew this should be fine .. you could try to post it in our discussion group .. maybe someone has a suggestion

     
  43. matt says...

    Im running NT2K and IIS5….with all browsers ive tried I keep getting this error. I loaded the ajaxed folder into my webs root so everything is as the docs say to load it…

    But im getting this error…any idea why?

    Microsoft VBScript runtime error ‘800a01b6′

    Object doesn’t support this property or method: ‘codePage’

    /ajaxed/class_ajaxedPage/ajaxedPage.asp, line 318

     
  44. Michal says...

    hi matt .. afaik codepage is supported with IIS 5.1 and higher … so 5.0 is not good

     
  45. Josh L says...

    Hi,

    Very cool stuff! If anyone here is interested in doing classic ASP work in either a full time or part time capacity, let me know. I typically would not post this type of question here, but based upon the content of this particular blog and those reading it, this audience is the type of crew we are definitely looking for.

    Thanks!

     
  46. Natalie says...

    I was wondering if there is going to be functions made for file upload with ajax?

     
  47. Michal says...

    natalie there will be but i dont know when … could take some while .. the next release is coming soon: it includes e.g. a logger, generic email component, …

     
  48. Alimomer says...

    Thanks you So much…

     
  49. Caesar C. Cesar says...

    Greetings from Brazil !!!

    It’s one of the most useful framework ever done for a ancient language (hehehe). It’s helping me to avoid hours learning new freak languages to get right the same result I always got with classic ASP in my personal projects.

    Thanks a lot…

    I just ask for more samples and if you have time to send me any little sample of getting data from DB to show it on a table result I will be more grateful.

     
  50. Michal says...

    hey caesar thx for your comment ... its good to hear that ppl still need classic asp now and then ;)
    regarding your question pls read first http://www.webdevbros.net/2007/07/16/using-a-database-with-ajaxed/ which explains how to use database with ajaxed.
    but creating a table is easy and basically the same as u would do it without ajaxed:

    ASP:
    1. <table>
    2. <%
    3. set RS = db.getRecordset("SELECT * FROM....")
    4. while not RS.eof
    5. %>
    6.   <tr>
    7.     <td><%= RS("columname") %></td>
    8.   </tr>
    9. <% RS.movenext() : wend %>
    10. </table>

     
  51. Caesar C. Cesar says...

    Hey man, are you kidding me ? eheheheh
    I know very well how to create a table from a DB, I have a lot of personal projects working fine...

    I'm having problems to do it with ajaxed framework...

    I mean, create dynamic table from callback vbscript sub...

    Right now I'm getting data from this callback function and them I put it within DIVs by innerHtml, one by one, it's not funny for complex tables...

     
  52. John_Pharoh says...

    hi Caeser i know how make table by Javascript inside the callback,
    create first a table with id="varTbl" then this is simple code

    JAVASCRIPT:
    1. for (i=0;i &lt;recs.length;i++) {
    2.     var row1 = $('varTbl').insertRow($('varTbl').rows.length);
    3.     var content1 = row1.insertCell(0);
    4.     var content2 = row1.insertCell(1);
    5.     content1.innerHTML = "" + recs[i].firstvalue + "";
    6.     content2.innerHTML = "" + recs[i].secvalue + "";
    7.        }

    this a sample of code :D

     
  53. Mohiuddin Khan Inamdar says...

    Hi,
    First of all thanks for such a wonder full framework. It will help me avoid wasting time learning the SO CALLED NEW LANG which give the same effect as existing ones.
    Still worse It will save all the world done in older languages, bring them up to speed...

    Thanks for sharing this,

     
  54. Web Dev Bros » Blog Archive » ASP JSON utility version 1.5 released says...

    [...] who helped making this little tool what it is. Dont forget that it is a major component within the ajaxed library. Using ajaxed makes your life even more easier [...]

     
  55. Web Dev Bros » Blog Archive » ajaxed gets a face says...

    [...] proudly present the new logo of our ajaxed library. Just achieve a bit of identity ;) What do you think? Do you like it or is it just another [...]

     
  56. Lil says...

    Wow...just finished installing this. Maybe I can learn how to use AJAX after all! I use ASP for my sites and see no compelling reason to switch to .NET. ASP is so easy to understand and to use. If I can master AJAX, I'll find lots of ways to use it in my ASP apps.

     
  57. ricva says...

    Add 2 numbers demo does not work, on your site and mine. Getting HTTP 500. Please advise, I would like to try and use this.

    Thanks

     
  58. ricva says...

    I figured it out - I needed to have the ajaxedConfig folder copied over also.

     
  59. Web Dev Bros » Blog Archive » Launched with ajaxed: Tourmandu - Platform for local tour guides says...

    [...] proudly announce the launch of a new project developed with ajaxed - yes with classic asp :). It’s a platform for everyone who wants to show tourists/visitors [...]

     
  60. Antony says...

    Hi there,
    Thankyou for your time and energy in creating, and making available, this superb tool.
    Could you please let me know if there is any way of getting the "loading..." to appear in a specific element on the page.
    Many thanks,
    Antony

     
  61. Michal says...

    you can position the loading indicator with CSS as you need it.

     

Leave a Reply


Please surround code with [asp]..[/asp], [javascript]..[/javascript], [php]..[/php], [html]..[/html] to highlight source code within your comments.