這段時間一直在“研究”(不太好意思用這個詞)WCFService,覺得挺好玩的。下面把一個用JavaScript調用WCFService的執行個體分享給大家。註:為貪圖省事,WCFService與調用者均在一個網站項目裡。HostService方式也採用了最普通的IIS承載。1、建立一個介面,用於條件約束服務提供的方法。Code highlighting produced by Actipro CodeHighlighter
rblType.Attributes["onclick"] = "javascript:getRadioSelectedValue('"+rblType.ClientID +"');"; function getRadioSelectedValue(objname) { var radioList=document.getElementById(objname); var options = radioList.getElementsByTagName('input');
原理:非同步提交POST資料到Web Services的方法上,分析返回的xml資料,獲得結果。下面是用比較流行的Ajax架構JQuery來實現剛才的操作。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html
CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><script language="javascript"> var empty = {}; var point = { x: 0, y: 0 }; var cirle = { x: point.x, y: point.y, raduis:
<script language="JavaScript" defer>//qswh's original and modifid by windy_sk <windy_sk@126.com> 20040120function reportError(msg,url,line) { var str = "You have found an error as below: \n\n"; str += "Err: " + msg + " on line: " + line;
<textarea rows=5 cols=30 id=abc>祖父聽說我要帶女朋友去釣魚,也想去會會她。我帶了女朋友先去,等候祖父的時候,我已釣到了一條18公斤重的鱸魚。祖父到了,我把女友介紹給他認識,又舉起那條魚給他看。真不錯!他說,怎樣釣上的?用蚯蚓。我回答。那就奇了,他故意一本正經地說,我那一代至少要用一頓飯和一場電影!</textarea><script language=JScript>/*Create by Bound0 on