正在加载图片...
Adam howitt Duo Consulting 7/720061223PM Rendered results Rendered results require the user of the prototype function AJAX Updater which looks ike this var reportError function (t)t alert('error t status tt statusText) function getHelp(helptext)( var url =index. cfm? fuseaction=cpd gethelp 'i var params ='&helptype='thelptext var ajax new Ajax Updater my DivId [method: get' parameters: params onFailure: reporterror, Breaking this down into more manageable chunks we see three parameters passed to the function. The first is the container to be updated on successful completion of the request; the second is the URL of the remote page to retrieve the rendered HTML and lastly, the options parameter which is further broken down into three elements. Method specifies that the parameters should be submitted using get as opposed to post Parameters is a query string beginning with an ampersand e.g. &id=l"and lastly on Failure names a function to execute should there be a transmission error with the AJAX call It is as simple as that to serve up a rendered chunk of HTML content! The scriptaculous wikiathttp://wiki.script.aculo.us/scriptaculous/show/ajax.Updaterhasamoreindepth outline of the parameters if you need further information Functional results Functional results require the user of the prototype function AJAX Request which looks like th var handler func function //handle result var reportError function(t) alert('Error t status+ t statustext)i function checkAvailability(activity code) var url ='index. cfm? fuseaction=cpd. checkAvailability'i act⊥vit new Ajax Request( Parameters: params handler func, 7/8Adam Howitt Duo Consulting 7/7/2006 12:23 PM Rendered results Rendered results require the user of the prototype function AJAX.Updater which looks like this: var reportError = function(t) { alert('Error ' + t.status + ' -- ' + t.statusText); } function getHelp(helptext) { var url = 'index.cfm?fuseaction=cpd.gethelp'; var params = '&helptype='+helptext; var ajax = new Ajax.Updater ( ’myDivId’, url, {method: 'get', parameters: params, onFailure: reportError, } ); } Breaking this down into more manageable chunks we see three parameters passed to the function. The first is the container to be updated on successful completion of the request; the second is the URL of the remote page to retrieve the rendered HTML and lastly, the options parameter which is further broken down into three elements. Method specifies that the parameters should be submitted using get as opposed to post. Parameters is a query string beginning with an ampersand e.g. “&id=1” and lastly onFailure names a function to execute should there be a transmission error with the AJAX call. It is as simple as that to serve up a rendered chunk of HTML content! The scriptaculous wiki at http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater has a more in depth outline of the parameters if you need further information. Functional results Functional results require the user of the prototype function AJAX.Request which looks like this: var handlerFunc = function(t) { //handle result } var reportError = function(t) { alert('Error ' + t.status + ' -- ' + t.statusText); } function checkAvailability(activity_code) { var url = 'index.cfm?fuseaction=cpd.checkAvailability'; var params = '&activity_code='+helptext; new Ajax.Request( url, {parameters: params, onSuccess:handlerFunc, 7/8
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有