Index: Changes.txt =================================================================== --- Changes.txt (revision 92) +++ Changes.txt (working copy) @@ -1,12 +1,26 @@ SAJAX CHANGELOG --------------- +Sajax version 0.13 (August 26, 2009) + +* [php] Use php native json_encode for serilization of responce data. +* [php] use of JSON.parse on client side for better speed and security. +* [php] per function GET/POST +* [php] Autoselect POST if request is to large data for GET +* [php] Synchronous mode +* [php] gratly improved error handeling on both client and server side +* [php] Support for utf-8 and international charectors +* [php] Better handeling of IE (no more warnings in IE7+) +* [cf] Updated to match the PHP implementation. + Sajax version 0.12 (January 30, 2006) * [php] Numerous improvements to serialization, support for varied PHP setups, addition of sajax_cancel(). * [asp] Removed due to serious bugs +Sajax version 0.11 () Unreleased beta. + Sajax version 0.10 (March 21, 2005) * [php] Support for POST instead of just GET. Set $sajax_request_type. @@ -53,4 +67,3 @@ * [python] Backend port added. Thanks to Adam Collard. Please note that this port is licensed under the Creative Commons "By" License version 2.0. - Index: coldfusion/example_multiply.cfm =================================================================== --- coldfusion/example_multiply.cfm (revision 92) +++ coldfusion/example_multiply.cfm (working copy) @@ -1,20 +1,25 @@ - + function multiply(x, y) { return x * y; } - sajax_init(); - //sajax_debug_mode = 1;: +// sajax_debug_mode = true; + sajax_failure_redirect = "http://sajax.info/sajaxfail.html"; sajax_export("multiply"); sajax_handle_client_request(); - - + + - Multiplier - + + + + - + //--> + - - * - - = - - + +* + += + + Index: coldfusion/Readme.txt =================================================================== --- coldfusion/Readme.txt (revision 92) +++ coldfusion/Readme.txt (working copy) @@ -1,5 +1,4 @@ SAJAX COLDFUSION MX BACKEND --------------------------- -Contributed by Eric Moritz. - +Contributed by Eric Moritz . Maintained by Steve Smith and Anders Jenbo \ No newline at end of file Index: coldfusion/sajax.cfm =================================================================== --- coldfusion/sajax.cfm (revision 92) +++ coldfusion/sajax.cfm (working copy) @@ -1,230 +1,148 @@ - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - uri = cgi.query_string; - if (find(uri,"?") gt 0) - uri = uri & "?rs=" & urlencodedformat(func_name); - else - uri = uri & "&rs=" & urlencodedformat(func_name); - uri = cgi.script_name & uri; - - - - // wrapper for #func_name# - - function x_#func_name#() { - // count args; build URL - - sajax_do_call("#func_name#", - "#sajax_esc(uri)#", - x_#func_name#.arguments); - } - - - - - // remote scripting library - // (c) copyright 2005 modernmethod, inc - var sajax_debug_mode = #iif(sajax_debug_mode,'"true"','"false"')#; - - function sajax_debug(text) { - if (sajax_debug_mode) - alert("RSD: " + text) - } - function sajax_init_object() { - sajax_debug("sajax_init_object() called..") - - var A; - try { - A=new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - A=new ActiveXObject("Microsoft.XMLHTTP"); - } catch (oc) { - A=null; - } - } - if(!A && typeof XMLHttpRequest != "undefined") - A = new XMLHttpRequest(); - if (!A) - sajax_debug("Could not create connection object."); - return A; - } - function sajax_do_call(func_name, url, args) { - var i, x, n,responseText; - url = url + "&rsargs="; - for (i = 0; i < args.length-1; i++) - url = url + escape(args[i]) + escape("#JSStringFormat(sajax_url_array_delim)#"); - url = url + "&rsrnd=" + new Date().getTime(); - x = sajax_init_object(); - x.open("GET", url, true); - x.onreadystatechange = function() { - if (x.readyState != 4) + + + + + if(not isdefined("URL.rs") and not isdefined("FORM.rs")) return; - responseText = x.responseText.replace(/^\s+/,''); // remove leading space, cf loves to put extra whitespace. - sajax_debug("received " + responseText); + if(isdefined("URL.rs")) { + func_name = URL.rs; + if(isdefined("URL.rsargs")) + args = URL.rsargs; + } else { + func_name = FORM.rs; + if(isdefined("FORM.rsargs")) + args = FORM.rsargs; + } - var status; - var data; - status = responseText.charAt(0); - data = responseText.substring(1); - if (status == "-") - alert("Error: " + data); - else - args[args.length-1](data); - } - x.send(null); - sajax_debug(func_name + " url = " + url); - sajax_debug(func_name + " waiting.."); - delete x; - } + if(isdefined("args")) { + args = DeserializeJSON(args); + } else { + args = arraynew(1); + } + if(not ListFindNoCase(sajax_export_list, func_name)) { + error = "#func_name# not callable"; + } else { + result = SerializeJSON(call_user_func_array(func_name, args)); + } + + + + + -:#cfcatch.type# +#cfcatch.message# +#cfcatch.detail# + +in #cfcatch.tagcontext[1].template# at #cfcatch.tagcontext[1].line# + + + + + + + //Remove start and end white space from output + output = REReplace(output,"^\s*|\s*$","","ALL"); + if(isdefined("result") and "#output#" eq "") + writeoutput("+:#result#"); + else if("#output#" eq "") + writeoutput("-:#error#"); + else + writeoutput("-:#output#"); + exit(); + - - var func_name=""; - var result=0; - - - - + sajax_js_has_been_shown = false; + function sajax_show_javascript() + { - - if(not isdefined("url.rs")) - return; - - func_name = url['rs']; - if(not ListFindNoCase(sajax_export_list, func_name)) - writeoutput("-:#func_name# not callable"); - else { - writeoutput("+"); - if(not isdefined("url.rsargs")) - result = call_user_func(url['rs']); - else - result = call_user_func_array(url['rs'], get_url_array(url['rsargs'])); - if(isdefined("result")) - writeoutput(result); + if (not sajax_js_has_been_shown) { + + writeoutput(" + sajax_debug_mode = #iif(sajax_debug_mode, 'true', 'false')#; + sajax_failure_redirect = ""#sajax_failure_redirect#""; +"); + //TODO get from an array instead of list + size = listlen(sajax_export_list); + for(i = 1; i lte size; i=i+1) { + name = listgetat(sajax_export_list, i); + method = listgetat(sajax_method_list, i); + asynchronous = listgetat(sajax_asynchronous_list, i); + uri = listgetat(sajax_uri_list, i); + if(uri == "##") + uri = ""; + writeoutput(" + function x_#name#() { + return sajax_do_call(""#name#"", arguments, ""#method#"", #asynchronous#, ""#uri#""); + }"); + } + sajax_js_has_been_shown = true; } - if(sajax_test_mode eq 0) - exit(); - - -#output# - --#cfcatch.type# - #cfcatch.message# - #cfcatch.detail# - - in #cfcatch.tagcontext[1].template# at #cfcatch.tagcontext[1].line# - - - - - - - - sajax_debug_mode = 0; -sajax_test_mode = 0; -sajax_export_list = ""; -sajax_url_array_delim = chr(31); -function call_user_func(user_func) { - return(call_user_func_array(user_func,arraynew(1))); -} -function sajax_export() { - var keys = structkeylist(arguments); - var size = listlen(keys); - var key = ""; - - for(i =1; i lte size;i=i+1) { - key = listgetat(keys,i); - sajax_export_list = listappend(sajax_export_list,arguments[key]); } -} -function call_user_func_array(user_func, arg_array) { - var func_call = ""; - var func_args = ""; - var size = ArrayLen(arg_array); - - /* Loop though each of the args */ - for(i=1; i lte size; i = i + 1) { - func_args = func_args & "arg_array[#i#]"; - if(i lt size) - func_args = func_args & ","; - } - - return(evaluate("#user_func#(#func_args#)")); -} -function get_url_array(url_array) { - return(ListToArray(url_array,sajax_url_array_delim)); -} - -function set_url_array(array) { - return(ArrayToList(array,sajax_url_array_delim)); -} - -function sajax_init() { -} - - - - - function sajax_show_common_js() { - sajax_get_common_js(); - } - // javascript escape a value - function sajax_esc(val) - { - return(jsstringformat(val)); + function sajax_export() { + //TODO make it a multi dimentional array of options + //TODO prevent multiple instances of the same functions + //if(not isarray(function)) + var keys = structkeylist(arguments); + var size = listlen(keys); + var key = ""; + + for(i=1; i lte size;i=i+1) { + key = listgetat(keys, i); + sajax_export_list = listappend(sajax_export_list, arguments[key]); + sajax_method_list = listappend(sajax_method_list, sajax_request_type); + sajax_asynchronous_list = listappend(sajax_asynchronous_list, sajax_request_asynchronous); + if(sajax_remote_uri == "") + sajax_remote_uri = "##"; + sajax_uri_list = listappend(sajax_uri_list, sajax_remote_uri); + if(sajax_remote_uri == "##") + sajax_remote_uri = ""; + } } - - function sajax_show_one_stub(func_name) { - sajax_get_one_stub(func_name); - } + function call_user_func_array(user_func, arg_array) { + //TODO test with multi dimentional arrays + var func_call = ""; + var func_args = ""; + var size = ArrayLen(arg_array); - sajax_js_has_been_shown = 0; - function sajax_get_javascript() - { - if (not sajax_js_has_been_shown) { - sajax_get_common_js(); - sajax_js_has_been_shown = 1; + /* Loop though each of the args */ + for(i=1; i lte size; i = i + 1) { + func_args = func_args & "arg_array[#i#]"; + if(i lt size) + func_args = func_args & ","; } - - size = listlen(sajax_export_list); - for(i = 1; i lte size; i=i+1) { - func = listgetat(sajax_export_list,i); - sajax_get_one_stub(func); - } - } - function sajax_show_javascript() - { - sajax_get_javascript(); + return evaluate("#user_func#(#func_args#)"); } SAJAX_INCLUDED = 1; - Index: php/example_multiply.php =================================================================== --- php/example_multiply.php (revision 92) +++ php/example_multiply.php (working copy) @@ -1,23 +1,26 @@ - - + + - Multiplier - + + + + - + //--> + - - * - - = - - + +* + += + + Index: php/example_options.php =================================================================== --- php/example_options.php (revision 92) +++ php/example_options.php (working copy) @@ -1,55 +1,83 @@ -$v) { - $s .= "$k:$v\n"; - } - return $s; - } - + return test(); + } + function test_post() { - $s = "-- POST --\n"; - foreach ($_POST as $k=>$v) { - $s .= "$k:$v\n"; - } + return test(); + } + + function test() { + $s = "URI: ".$_SERVER['PHP_SELF']; + $s .= "\n\n-- GET --\n"; + if(!empty($_GET["rsargs"])) + $s .= $_GET["rsargs"]; + + $s .= "\n-- POST --\n"; + if(!empty($_POST["rsargs"])) + $s .= $_POST["rsargs"]; + return $s; } - + function get_the_time() { return date("Y-m-d h:i:s"); } - - // $sajax_debug_mode = 1; - sajax_init(); - sajax_export("test_get", "test_post", "get_the_time"); - sajax_handle_client_request(); - + + require_once("sajax.php"); +// $sajax_debug_mode = true; + $sajax_failure_redirect = "http://sajax.info/sajaxfail.html"; + sajax_export( + array("name" => "test_get", "method" => "GET"), + array("name" => "test_post", "method" => "POST"), + array("name" => "get_the_time", "method" => "GET"), + array("name" => "test", "method" => "GET"), + array("name" => "sleep", "asynchronous" => false), + array("name" => "otherefucntion", "uri" => "example_otheruri.php"), + array("name" => "otherefucntion2") + ); + sajax_handle_client_request(); + ?> - + + + Example of Sajax Options - + + + + - + + - - + + + + + + -
-Time will appear here -
+ + + + + + + +
Time will appear here
Index: php/example_types.php =================================================================== --- php/example_types.php (revision 92) +++ php/example_types.php (working copy) @@ -1,11 +1,15 @@ - "Tom", "age" => 26); + global $age; + return array("name" => "Anders", "age" => $age); } function return_object() { + global $age; class MyObj { var $name, $age; @@ -14,58 +18,68 @@ $this->age = $age; } } - $o = new MyObj("Tom", 26); + $o = new MyObj("Anders", $age); return $o; } - function return_string() { - return "Name: Tom / Age: 26"; - } - function return_int() { - return 26; + global $age; + return floor($age); } function return_float() { - return 26.25; + global $age; + return $age; } + function return_string() { + global $age; + return "Anders is ".floor($age)." years old."; + } + + require("sajax.php"); $sajax_request_type = "GET"; - sajax_init(); - sajax_export("return_array", "return_object", "return_string", - "return_int", "return_float"); - sajax_handle_client_request(); +// $sajax_debug_mode = true; + $sajax_failure_redirect = "http://sajax.info/sajaxfail.html"; + sajax_export("return_array", "return_object", "return_int", "return_float", "return_string"); + sajax_handle_client_request(); ?> - + + - + + + + + - + - Index: php/example_wall.php =================================================================== --- php/example_wall.php (revision 92) +++ php/example_wall.php (working copy) @@ -1,9 +1,11 @@ $dt $msg
\n"); + fwrite($f, ''.$date.' '.htmlspecialchars($msg).'
'."\r\n"); fclose($f); + return refresh(0); } - function refresh() { - $lines = file("/tmp/wall.html"); - // return the last 25 lines - return join("\n", array_slice($lines, -25)); + function refresh($lastrefresh) { + global $filename; + if(filemtime($filename) > $lastrefresh) { + $lines = file($filename); + // return the last 25 lines + return array("wall" => join("\n", array_slice($lines, -25)), "update" => filemtime($filename)); + } else { + return false; + } } - $sajax_request_type = "GET"; - sajax_init(); - sajax_export("add_line", "refresh"); - sajax_handle_client_request(); + require("sajax.php"); +// $sajax_debug_mode = true; + $sajax_failure_redirect = "http://sajax.info/sajaxfail.html"; + sajax_export( + array("name" => "add_line", "method" => "POST"), + array("name" => "refresh", "method" => "GET") + ); + sajax_handle_client_request(); ?> - + + - Wall - - + + + + function keypress(keyCode) { + if (keyCode==13) { + add(); + document.getElementById("line").select(); + return false; + } + return true; + } + + nextrefresh = setTimeout("refresh();", 1000); + //--> + - - -
- Sajax - v - - - You are a guinea pig - - - This example illustrates the simplest possible graffiti wall. - It isn't meant to be perfect, featureful, or even useful.
- - - - -
-
Loading..
+ +Sajax v - You are a guinea pig - This example illustrates the simplest possible graffiti wall. It isn't meant to be perfect, featureful, or even useful.
+ + + +
- +
+
Checked #0
Index: php/Readme.txt =================================================================== --- php/Readme.txt (revision 92) +++ php/Readme.txt (working copy) @@ -1,7 +1,33 @@ SAJAX PHP BACKEND ----------------- -Contributed and copyighted by Thomas Lackner and ModernMethod -(http://www.modernmethod.com/). +Contributed and copyighted by Thomas Lackner (http://www.modernmethod.com/) and Anders Jenbo. +If you are using PHP < 5.2 you will need to a substitue for JSON_encode and JSON_decode, you might want to try this out http://abeautifulsite.net/notebook/71 +Usage: +sajax_export() takes a list of functions that are alowed to be called from javascript, there are 4 parameters for each function you send to sajax_export. If strings are used in stead of arrays the functions will just have all options set to there default (like in older versions of Sajax). + +name = the name of the function (requred) +method = GET : POST (default is GET) +asynchronous = true : false (default is true, if set to false the script will pause untill the call has been compleated) +uri = the uri where the function lives. + +The default method can be changed by setting $sajax_request_type to "POST" (this can also be done at runtime). +The default uri can be changed by setting $sajax_remote_uri (this can also be done at runtime). + +Sample: +sajax_export( + "myFunction", + array("name" => "myPostFunction", "method" => "POST"), + array("name" => "sleep", "asynchronous" => true), + array("name" => "myOffSitefunction", "uri" => "http://myotheresite.com/ajax.php") +); + +sajax_export() may be called multiple times. + +To get debug alert's set $sajax_debug_mode to true. + +You can redirect the users browser to a frindly error page incase his/her borwser issn't supported by sajax by setting $sajax_failure_redirect to an URI. + +Calling sajax_get_common_js() will print the client side script. \ No newline at end of file Index: php/Sajax.php =================================================================== --- php/Sajax.php (revision 92) +++ php/Sajax.php (working copy) @@ -1,361 +1,141 @@ -$v) { - $esc_key = sajax_esc($k); - if (is_numeric($k)) - $s .= "$k: " . sajax_get_js_repr($v) . ", "; - else - $s .= "\"$esc_key\": " . sajax_get_js_repr($v) . ", "; - } - if (count($value)) - $s = substr($s, 0, -2); - return $s . " }"; - } - else { - $esc_val = sajax_esc($value); - $s = "'$esc_val'"; - return $s; - } - } - function sajax_handle_client_request() { - global $sajax_export_list; - - $mode = ""; - - if (! empty($_GET["rs"])) - $mode = "get"; - - if (!empty($_POST["rs"])) - $mode = "post"; - - if (empty($mode)) + if (empty($_GET["rs"]) && empty($_POST["rs"])) return; - - $target = ""; - if ($mode == "get") { - // Bust cache in the head - header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past - header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - // always modified - header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 - header ("Pragma: no-cache"); // HTTP/1.0 + ob_start(); + + if (!empty($_GET["rs"])) { + // Always call server + header ("Cache-Control: max-age=0, must-revalidate"); // HTTP/1.1 + header ("Pragma: no-cache"); // HTTP/1.0 $func_name = $_GET["rs"]; - if (! empty($_GET["rsargs"])) + if (! empty($_GET["rsargs"])) $args = $_GET["rsargs"]; - else - $args = array(); - } - else { + } else { $func_name = $_POST["rs"]; - if (! empty($_POST["rsargs"])) + if (! empty($_POST["rsargs"])) $args = $_POST["rsargs"]; - else - $args = array(); } - if (! in_array($func_name, $sajax_export_list)) - echo "-:$func_name not callable"; - else { - echo "+:"; - $result = call_user_func_array($func_name, $args); - echo "var res = " . trim(sajax_get_js_repr($result)) . "; res;"; - } - exit; - } - - function sajax_get_common_js() { - global $sajax_debug_mode; - global $sajax_request_type; - global $sajax_remote_uri; - global $sajax_failure_redirect; - - $t = strtoupper($sajax_request_type); - if ($t != "" && $t != "GET" && $t != "POST") - return "// Invalid type: $t.. \n\n"; - - ob_start(); - ?> - - // remote scripting library - // (c) copyright 2005 modernmethod, inc - var sajax_debug_mode = ; - var sajax_request_type = ""; - var sajax_target_id = ""; - var sajax_failure_redirect = ""; - - function sajax_debug(text) { - if (sajax_debug_mode) - alert(text); - } - - function sajax_init_object() { - sajax_debug("sajax_init_object() called..") - - var A; - - var msxmlhttp = new Array( - 'Msxml2.XMLHTTP.5.0', - 'Msxml2.XMLHTTP.4.0', - 'Msxml2.XMLHTTP.3.0', - 'Msxml2.XMLHTTP', - 'Microsoft.XMLHTTP'); - for (var i = 0; i < msxmlhttp.length; i++) { - try { - A = new ActiveXObject(msxmlhttp[i]); - } catch (e) { - A = null; - } - } - - if(!A && typeof XMLHttpRequest != "undefined") - A = new XMLHttpRequest(); - if (!A) - sajax_debug("Could not create connection object."); - return A; - } - - var sajax_requests = new Array(); - - function sajax_cancel() { - for (var i = 0; i < sajax_requests.length; i++) - sajax_requests[i].abort(); - } - - function sajax_do_call(func_name, args) { - var i, x, n; - var uri; - var post_data; - var target_id; + if(! empty($args)) { + if(get_magic_quotes_gpc()) + $args = stripslashes($args); - sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id); - target_id = sajax_target_id; - if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "") - sajax_request_type = "GET"; + $args = json_decode($args, true); - uri = ""; - 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 < args.length-1; i++) - uri += "&rsargs[]=" + escape(args[i]); - - post_data = null; - } - else if (sajax_request_type == "POST") { - post_data = "rs=" + escape(func_name); - post_data += "&rst=" + escape(sajax_target_id); - post_data += "&rsrnd=" + new Date().getTime(); - - for (i = 0; i < args.length-1; i++) - post_data = post_data + "&rsargs[]=" + escape(args[i]); - } - else { - alert("Illegal request type: " + sajax_request_type); - } - - x = sajax_init_object(); - if (x == null) { - if (sajax_failure_redirect != "") { - location.href = sajax_failure_redirect; - return false; - } else { - sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent); - return false; + if(get_magic_quotes_gpc()) { + function array_addslashes($value) { + if(is_array($value)) + return array_map("array_addslashes", $value); + else + return addslashes($value); } - } else { - x.open(sajax_request_type, uri, true); - // window.open(uri); - sajax_requests[sajax_requests.length] = x; - - if (sajax_request_type == "POST") { - x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1"); - x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); - } - - x.onreadystatechange = function() { - if (x.readyState != 4) - return; - - sajax_debug("received " + x.responseText); - - var status; - var data; - var txt = x.responseText.replace(/^\s*|\s*$/g,""); - status = txt.charAt(0); - data = txt.substring(2); - - if (status == "") { - // let's just assume this is a pre-response bailout and let it slide for now - } else if (status == "-") - alert("Error: " + data); - else { - if (target_id != "") - document.getElementById(target_id).innerHTML = eval(data); - else { - try { - var callback; - var extra_data = false; - if (typeof args[args.length-1] == "object") { - callback = args[args.length-1].callback; - extra_data = args[args.length-1].extra_data; - } else { - callback = args[args.length-1]; - } - callback(eval(data), extra_data); - } catch (e) { - sajax_debug("Caught error " + e + ": Could not eval " + data ); - } - } - } - } + $args = array_map("array_addslashes", $args); } - - sajax_debug(func_name + " uri = " + uri + "/post = " + post_data); - x.send(post_data); - sajax_debug(func_name + " waiting.."); - delete x; - return true; + } else { + $args = array(); } - + global $sajax_export_list; - // wrapper for - - function x_() { - sajax_do_call("", - x_.arguments); + if (! in_array($func_name, $sajax_export_list)) { + $error = $func_name." not callable"; + } else { + $result = call_user_func_array($func_name, $args); + + $error = ob_get_contents(); + ob_end_clean(); } - + sajax_debug_mode = ; + sajax_failure_redirect = ""; + + function x_() { + return sajax_do_call("", arguments, "", , ""); + } + $function); + + if(!isset($function["method"])) + $function["method"] = $sajax_request_type; + + if(!isset($function["asynchronous"])) + $function["asynchronous"] = true; + + if(!isset($function["uri"])) + $function["uri"] = $sajax_remote_uri; + + $key = array_search($function["name"], $sajax_export_list); + if ($key === false) { + $sajax_export_array[] = $function; + $sajax_export_list[] = $function["name"]; + } else { + //Overwrite old function + $sajax_export_array[$key] = $function; + $sajax_export_list[$key] = $function["name"]; + } + } } - $SAJAX_INCLUDED = 1; } -?> +?> \ No newline at end of file Index: Readme.txt =================================================================== --- Readme.txt (revision 92) +++ Readme.txt (working copy) @@ -6,9 +6,22 @@ For more information about Sajax, please see the homepage: - http://www.modernmethod.com/sajax/ + http://sajax.info/ In this archive you will find a folder for each platform that is currently supported. Please see individual documentation in each folder for specific errata. + + +As of 0.13 a JavaScript implementation of JSON.stringify() has +become a requirement when sending data for browsers that does not +have this nativly (IE8 or FF3.5). JSON2 from +http://www.json.org/js.html has been included for this reason. + +It is highly recomented to also include a JSON.parse() +implementation for better security for the client, especialy when +handeling data from othere sites, json.parse.js is the +implementation from JSON2, unfortunatly this breaks Safari 1.3.2 +json_parse_state.js seams to be the most compatible but +json_parse.js might also be worth checking out. \ No newline at end of file Index: Todo.txt =================================================================== --- Todo.txt (revision 92) +++ Todo.txt (working copy) @@ -1,7 +1,6 @@ SAJAX TO DO LIST ---------------- * Fix http://www.modernmethod.com/sajax/forum/viewtopic.php?p=308 -* Return false if the object could not be created. * Make the whole darn thing an object * Add J2EE module * Apply Julien Grossiord's port non-80 patch. @@ -10,14 +9,16 @@ * Test if a function exists before allowing you to export it * Add Kae's IFRAME patch. * Add C# support. -* All-numeric array indices -> JS array, not object. +* Update othere backends to match php in 0.13. THINGS THAT WERE TO DO AND ARE NOW TO DONE ------------------------------------------ +* All-numeric array indices -> JS array, not object. * Encode/serialize array elements +* Return false if the object could not be created. * Support for "options" such as post-to-an-ID and POST/GET submit. * Added sajax_set_remote_url or something along those lines instead of $REQUEST_URI * Support POST * Add CFML, ASP.Net -* Fix Perl module (with the contributed code) +* Fix Perl module (with the contributed code) \ No newline at end of file