3 <script type="text/javascript" src="xynt/xynt-commons.js"></script>
4 <script type="text/javascript" src="xynt/xynt-console.js"></script>
5 <script type="text/javascript"><!--
7 function test_item(ins, nms, vls, out)
15 test_item.prototype = {
22 window.onload = function ()
26 test_items = new Array( new test_item("http://www.pippo.com", "assoli", "new_value", "http://www.pippo.com?assoli=new_value"),
27 new test_item("http://www.example.com/pippo/pluto.php?asso=1&assoli=2&assolino=3",
28 "assoli", "new_value",
29 "http://www.example.com/pippo/pluto.php?asso=1&assoli=new_value&assolino=3"),
30 new test_item("http://www.example.com/pippo/pluto.php?asso=1&assoli=2&assolino=3",
31 "bossoli", "new_value",
32 "http://www.example.com/pippo/pluto.php?asso=1&assoli=2&assolino=3&bossoli=new_value"),
34 new test_item("http://www.pippo.com", "assoli", "new_value_&_with_ampersand", "http://www.pippo.com?assoli=new_value_%26_with_ampersand"),
35 new test_item("http://www.example.com/pippo/pluto.php?asso=1&assoli=2&assolino=3",
36 "assoli", "new_value_&_with_ampersand",
37 "http://www.example.com/pippo/pluto.php?asso=1&assoli=new_value_%26_with_ampersand&assolino=3"),
38 new test_item("http://www.example.com/pippo/pluto.php?asso=1&assoli=2&assolino=3",
39 "bossoli", "new_value_&_with_ampersand",
40 "http://www.example.com/pippo/pluto.php?asso=1&assoli=2&assolino=3&bossoli=new_value_%26_with_ampersand"),
41 new test_item("http://dodo.birds.lan/xynt/test-hs-rd.php?sess=51583d21b104d28eac58b59f310499e5", "st", "-1", "http://dodo.birds.lan/xynt/test-hs-rd.php?sess=51583d21b104d28eac58b59f310499e5&st=-1"),
42 new test_item("http://dodo.birds.lan/xynt/test-hs-rd.php?sess=51583d21b104d28eac58b59f310499e5&st=-1", "st", "15", "http://dodo.birds.lan/xynt/test-hs-rd.php?sess=51583d21b104d28eac58b59f310499e5&st=15")
46 for (i = 0 ; i < test_items.length ; i++) {
47 $('cont').innerHTML += i+"<br>";
48 $('cont').innerHTML += "original: "+test_items[i].in+"<br>";
49 $('cont').innerHTML += "name: ["+ test_items[i].nm + "] value: ["+test_items[i].vl+"]<br>";
50 ret = url_append_arg(test_items[i].in, test_items[i].nm, test_items[i].vl);
51 $('cont').innerHTML += "result: "+ret+"<br>";
52 if (ret != test_items[i].out) {
55 $('cont').innerHTML += "<hr>";
58 if (i < test_items.length) {
59 $('cont').innerHTML += "<b>ERROR AT: "+i+"</b><br>";
62 $('cont').innerHTML += "<b>TEST SUCCESS</b><br>";