Format:
Recent snippets matching tags of Ajax
/////////////////////////////////////////// //From the service.cs side// /////////////////////////////////////////// //Make sure u include these namespaces using System.Web.Script.Services; using System.Web.Script.Serialization; //Have the webservice class have this Attribute to allow ajax calls [System.Web.Script.Services.ScriptService]
12 Views
no comments
jQuery(document).ready(function(){ jQuery(document).ajaxSend(function(e,XHR,options){ //loading提示 hb.util.Message.show({ msg:hb.util.context.msg.comm_loading, isCompleteClear:true, bar:[] }); }).ajaxError(function(e,XHR,settings,thrownError){
72 Views
no comments
/* Google jquery CDN <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> */ $.ajax( { type: "POST", contentType: "application/json; charset=utf-8", url: "services/FeedService.svc/ServiceMethod", data: '{"param1":"data1" , "param2":"data2"}', dataType: "json",
63 Views
no comments
$.ajax({
url: 'Service.asmx/Method',
type: 'POST',
contentType: 'application/json',
data: '{"Parameters":"Must be JSON strings!"}',
success: function(response) {
// Don't forget that the response is wrapped in a
// ".d" object in ASP.NET 3.5 and later.
console.log(response.d);
}
99 Views
no comments
if (!JSON) { // Autoload JSON2.js if possible // Note: if using a script loader you may have to explicitly load json2.js // assumes loading from same folder as this script var scripts = $("script"); var src = null; scripts.each(function (i) { src = $(this).attr("src"); if (src && src.toLowerCase().indexOf("serviceproxy.") > -1) { src = src.toLowerCase();
356 Views
no comments
$.ajaxSetup({
converters: { "text json": function (jsonString) {
var res = JSON.parseWithDate(jsonString);
if (res && res.hasOwnProperty("d"))
res = res.d;
return res;
} }
});
227 Views
no comments
This Issue resolved by using an Ajax:Accordion and some control transition. Thank you for your interest
171 Views
no comments
$("#loading_animation").bind({ ajaxStart: function() { $(this).show(); }, ajaxStop: function() { $(this).hide(); } });
495 Views
no comments
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server"> <style type="text/css"> .sys-template { display: none; } </style> <script src="../Scripts/MicrosoftAjax/MicrosoftAjax.js" type="text/javascript"></script> <script src="../Scripts/MicrosoftAjax/MicrosoftAjaxDataContext.js" type="text/javascript"></script>
572 Views
no comments
/// <reference path="jquery.js" /> /* ServiceProxy.js Version 0.981 - 4/5/11 (c) 2008-2011 Rick Strahl, West Wind Technologies www.west-wind.com Load json2.js before this library http://github.com/douglascrockford/JSON-js/blob/master/json2.js
3762 Views
no comments
// controller public ActionResult Index([DefaultValue(1)] int page) { if (Request.IsAjaxRequest()) return PartialView("PagedDataControl", model.Data); return View(model); } // .aspx
377 Views
no comments
// The view: Index.aspx <!-- the non-AJAX form to filter the list --> <% using (Html.BeginForm()) { %> <fieldset> <legend>Search</legend> <input name="SearchTerm" /> <input type="submit" value="Go" /> </fieldset> <% } %>
608 Views
no comments
// // GlossaryController.cs public ActionResult Index() { return View(Models.Term.SelectAll()); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Index(FormCollection collection)
510 Views
no comments
// LivePreviewPlugin.cs // using System; using System.Collections; using System.Html; using System.Runtime.CompilerServices; using jQueryApi; [Imported]
871 Views
1 comments
// GET ${src} // Range:bytes=${startposition}-${endposition} var rst = new ActiveXObject("Microsoft.XMLHTTP"); var act = document.getElementById("somediv"); function get_html() { rst.abort(); rst.open("GET", "www.baidu.com", true); rst.onreadystatechange = get_text; rst.setRequestHeader("Range","bytes=20-"); rst.send(null);
272 Views
no comments
function setWards(o) {
$.getJSON('/Home/GetWards/?cbd_id=' + o.value, null, function(data) {
$('#ward').empty();
$.each(data, function(i, item) {
$('<option/>').attr('value', item.ID).html(item.Name).appendTo('#ward');
});
});
}
279 Views
no comments
error: function(xhr, status) { var err = null; if (xhr.readyState == 4) { var res = xhr.responseText; if (res && res.substr(0,1) == '{') var err = JSON.parseWithDate(res); if (!err) { if (xhr.status && xhr.status != 200) err = new CallbackException(xhr.status + " " + xhr.statusText);
489 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
