|
// 2010 - [Your name]
$(document).ready(function(){var ddlCategory=$('#spanDdlCategory select');ddlCategory.change(function(){var categoryValue=$(this).val();GetStuffList(categoryValue);});});function GetStuffList(categoryValue){if(categoryValue==0){$('#divStuffList').html('');}
else{var method=$('#spanHttpMethod input:checked').val();switch(method){case'get':StuffSelection_Proxy.GetStuffListHttpGet(categoryValue,successCallback,failureCallback);break;case'post':StuffSelection_Proxy.GetStuffListHttpPost(categoryValue,successCallback,failureCallback);break;}}}
var successCallback=function(data){var response=eval(data.d);$('#divStuffList').html('');var template=$('#divStuffListTemplate').html();$(template).bindTo(response,{fill:true,appendTo:'#divStuffList'});}
var failureCallback=function(data){alert('Request failure');}
function StuffSelection_Proxy(){}
StuffSelection_Proxy.GetStuffListHttpGet=function(category,successCallback,failureCallback){$.ajax({type:"GET",contentType:"application/json; charset=utf-8",url:"StuffSelection.aspx/GetStuffListServiceHttpGet?category="+category,success:function(data){successCallback(data);},error:function(data){failureCallback(data);}});}
StuffSelection_Proxy.GetStuffListHttpPost=function(category,successCallback,failureCallback){var jsonData=JSON.stringify({category:category});$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:"StuffSelection.aspx/GetStuffListServiceHttpPost",data:jsonData,success:function(data){successCallback(data);},error:function(data){failureCallback(data);}});}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm the very proud father of
SyMenu, a multi awarded portable start menu and
www.ghezee.com an innovative ads web site.