14 Aug

Sajax, without ActiveX

On Friday, I announced a non-ActiveX version of XMLHttpRequest, with the proviso that it would require server-side magic.

Sajax 0.10 (the current “stable” version) does not provide that needed fiddliness, but, perfect timing, really, Sajax 0.11 does.

I have hacked that code and improved it. Here is my amended Sajax.php. The improvements:

  • The script falls back to IFrames if ActiveX is not supported.
  • You may have multiple Sajax instances attached to the same document, with different source URLs.

10 thoughts on “Sajax, without ActiveX

  1. John – I’ve had no need for POST yet, so am in no real rush to work on it. Feel free to do the work yourself and release the code. I don’t know how it would be done using the methods I’ve written, but I’m sure it will be interesting.

  2. your Sajax has error 🙁
    i try it and it can’t work with opera ver 7.51 and IE ver 6 🙁
    the bug said the error is:

    if(isArray(args[i]))args[i]=args[i].join(‘ARRAYDELIMITER’);

    could you give me suggestion, pls?
    thx a lot

  3. I can’t use your script 🙁 it shows a javascript error:
    Line: 95
    Char: 21
    Error: Object expected
    Code: 0

    the line 95 is:

    if(isArray(args[i]))args[i]=args[i].join(‘ARRAYDELIMITER’);
    uri += “&rsargs[]=” + escape(args[i]);

    if I change your code:

    if (sajax_request_type == “GET”) {

    if (uri.indexOf(“?”) == -1)
    uri += “?rs=” + escape(func_name);
    else
    uri += “&rs=” + escape(func_name);
    uri += “&rst=” + escape(sajax_target_id);
    uri += “&rsrnd=” + new Date().getTime();

    for (i = 0; i

  4. ah – sorry about that – the isArray is a custom function I load up by default with my own js library:

    function isArray(o){
    return o instanceof Array||typeof o==’array’;
    }

  5. ok, I try to test with the code below. it work now with IE 6.0, but it can’t work with opera 7.51. Could you give me suggestion, pls? thx a lot
    ====

    Multiplier

    function do_multiply_cb(z) {
    document.getElementById(“z”).value = z;
    }
    function do_multiply() {
    // get the folder name
    var x, y;
    x = document.getElementById(“x”).value;
    y = document.getElementById(“y”).value;
    x_multiply(x, y, do_multiply_cb);
    }

    *
    =

    =====

  6. your Sajax has error
    i try it and it can’t work with opera ver 7.51 and IE ver 6
    the bug said the error is:

    if(isArray(args[i]))args[i]=args[i].join(’ARRAYDELIMITER’);

    could you give me suggestion, pls?
    waiting

Comments are closed.