LeavingMe.net

CS3 与后台交互

2009-03-01 16:41:00

![](http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif)![](http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif)Code var variables:URLVariables = new URLVariables("name=Franklin"); var request:URLRequest = new URLRequest(); request.url = "http://localhost/greeting/"; request.method = URLRequestMethod.POST; request.data = variables; var loader:URLLoader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.VARIABLES; loader.addEventListener(Event.COMPLETE, completeHandler); try {     loader.load(request); } catch (error:Error) {     trace("Unable to load URL"); } function completeHandler(event:Event):void {     trace(event.target.data.welcomeMessage); }

 

http://localhost/greeting/default.asp

![](http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif)![](http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif)Code <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% name = request("name") if name <> "" then      response.write("welcomeMessage=Welcome, " & name) end if %>
comments powered by Disqus