metaw3
01-30-2008, 02:30 PM
Hello. First post here. Just sharing fresh code.
I tried to reply to this thread:
http://www.dynamicdrive.com/forums/showthread.php?t=11883
but it seemed locked: "you don't have the privileges to reply..."
That's the only page I found on the web almost about what I was playing with last night: emulating PHP $_GET with no other concern than making it readable and usable for a PHP developer not used to JS. So again: common JS coding guidelines as well as performance were not a concern. It's just an expermiment for fun.
Online: http://www.christianfecteau.com/echo/$_GET/$_GET.html
and attached...
$_GET = {}; // emualte PHP $_GET
(function(){ // by Christian Fecteau
var $params = location.search.substr(1).split('&');
for (var $i = 0; $i < $params.length; $i++) {
var $pair = $params[$i].split('=');
if ($pair[0])
$_GET[$pair[0]] = unescape($pair[1] || "");
}
})();
I tried to reply to this thread:
http://www.dynamicdrive.com/forums/showthread.php?t=11883
but it seemed locked: "you don't have the privileges to reply..."
That's the only page I found on the web almost about what I was playing with last night: emulating PHP $_GET with no other concern than making it readable and usable for a PHP developer not used to JS. So again: common JS coding guidelines as well as performance were not a concern. It's just an expermiment for fun.
Online: http://www.christianfecteau.com/echo/$_GET/$_GET.html
and attached...
$_GET = {}; // emualte PHP $_GET
(function(){ // by Christian Fecteau
var $params = location.search.substr(1).split('&');
for (var $i = 0; $i < $params.length; $i++) {
var $pair = $params[$i].split('=');
if ($pair[0])
$_GET[$pair[0]] = unescape($pair[1] || "");
}
})();