[phpwebapp-commits] CVS: web_app/session func.GoTo.js,1.4.2.1,1.4.2.2
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2004-10-12 09:23:42
|
Update of /cvsroot/phpwebapp/web_app/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12273/session Modified Files: Tag: phpwebapp-1_0 func.GoTo.js Log Message: Index: func.GoTo.js =================================================================== RCS file: /cvsroot/phpwebapp/web_app/session/func.GoTo.js,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** func.GoTo.js 12 Oct 2004 09:17:03 -0000 1.4.2.1 --- func.GoTo.js 12 Oct 2004 09:23:33 -0000 1.4.2.2 *************** *** 82,97 **** * Submits the form of the page to the 'target' specified as parameter * by taking care to serialize and transmit the session vars as well. ! * The 'target' parameter is something like this: ! * "page1.html?event=list.add(event_args)" ! * target_page and event are separated by '?' */ ! function GoTo(target) { var idx, target_page, event; ! var form; //debug if (debug_GoTo==true) alert("GoTo('"+target+"')"); //the 'target' parameter is something like this: //"page1.html?event=list.add(event_args)" --- 82,111 ---- * Submits the form of the page to the 'target' specified as parameter * by taking care to serialize and transmit the session vars as well. ! * ! * @param target is something like this: ! * "page1.html?event=list.add(event_args)" ! * target_page and event are separated by '?'; ! * if target_page is 'thisPage' then the target ! * is the same as the source. ! * @param action (optional) is the action to which the form is submitted; ! * if missing, then it is the same as the current url; ! * if 'index' then the file part is removed from the current url; */ ! function GoTo(target, action) { var idx, target_page, event; ! var form, href, app_href; //debug if (debug_GoTo==true) alert("GoTo('"+target+"')"); + //set the action of the form + if (action==null) action = location.href; + if (action=='index') + { + href = location.href; + action = href.replace(/[^\/\?]+(\?.*)?$/, ''); + } + //the 'target' parameter is something like this: //"page1.html?event=list.add(event_args)" *************** *** 123,126 **** --- 137,141 ---- //now submit the form + form.action = action; form.submit(); } |