正在加载图片...
Adam howitt Duo Consulting 7/7/20061223PN onFailure: errfunc))i The major difference between this and the ajaX Updater function is that there is no container passed to be updated and there is an additional option specified"on Success which tells the function to send the results to handler Func(. Again, the reference wiki at scriptaculous has a fuller description There is no support I could find for prototype to be able to make a request unique so I rolled my own. Both of the above scripts can be modified to add a line getUniqueToken(url This line references a function which, when passed a URL will append a string representing the current date and time down to the millisecond such that a user's browser is unlikely to be able to submit the same request in that exact millisecond function getUniqueToken(url)t var dt new Date(i var dtstring ='+dt. getFullYear()+ dt. getMonth()+ dt getDate()+dt. getHours ()t dt. getMinutes()+ dt. getMilliseconds() return dataurl This should be enough to get you started with the an AJAX application utilizing Prototype to build a functional application. For an example of a hand rolled AJAX applicationvisithttp://programs.chicagoparkdistrict.com/programbrowser/andforone builtusingprototypevisithttp:generatorduodesign.comandselecttheproposal generator once you have logged in with the username demo @duoconsulting com and http://wiki.scriptaculo.us/scriptaculous/show/aiax.Request 8/8Adam Howitt Duo Consulting 7/7/2006 12:23 PM onFailure:errFunc}); } The major difference between this and the AJAX.Updater function is that there is no container passed to be updated and there is an additional option specified “onSuccess” which tells the function to send the results to handlerFunc(). Again, the reference wiki at scriptaculous8 has a fuller description. Uniqueness There is no support I could find for prototype to be able to make a request unique so I rolled my own. Both of the above scripts can be modified to add a line: url = getUniqueToken(url); This line references a function which, when passed a URL will append a string representing the current date and time down to the millisecond such that a user’s browser is unlikely to be able to submit the same request in that exact millisecond: function getUniqueToken(url) { var dt = new Date(); var dtString = ''+dt.getFullYear()+ dt.getMonth()+ _ dt.getDate()+dt.getHours()+ dt.getMinutes()+ _ dt.getMilliseconds(); dataUrl = url + '&dtm='+dtString; return dataUrl; } This should be enough to get you started with the an AJAX application utilizing Prototype to build a functional application. For an example of a hand rolled AJAX application visit http://programs.chicagoparkdistrict.com/programBrowser/ and for one built using prototype visit http://generator.duodesign.com and select the proposal generator once you have logged in with the username demo@duoconsulting.com and password demo. 8 http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request 8/8
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有