CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Ajax
C#
///////////////////////////////////////////
//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]
by Egli   January 23, 2012 @ 8:04pm
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){
by x03570227   November 03, 2011 @ 7:21pm
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",
by frank2tek   October 04, 2011 @ 11:25am
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);
  }
by jaredmroberts   June 14, 2011 @ 10:16am
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();
by Rick Strahl   April 05, 2011 @ 9:57pm
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;
            } }
});
by Rick Strahl   April 05, 2011 @ 8:05pm
227 Views
no comments
 
This Issue resolved by using an Ajax:Accordion and some control transition.
 
Thank you for your interest
by hajloo   February 13, 2011 @ 2:47am
171 Views
no comments
 
$("#loading_animation").bind({
    ajaxStart: function() { $(this).show(); },
    ajaxStop: function() { $(this).hide(); }
});
by jaredmroberts   January 28, 2011 @ 1:00pm
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>
by Ross   August 11, 2010 @ 7:41am
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
by Rick Strahl   April 12, 2010 @ 6:40pm
Tags: JSON, Ajax, Date, ASMX, WCF
3762 Views
no comments
 
C#
// controller
public ActionResult Index([DefaultValue(1)] int page)
{
   if (Request.IsAjaxRequest())
      return PartialView("PagedDataControl", model.Data);
 
   return View(model);
}
 
// .aspx
by andreabalducci   March 30, 2010 @ 10:19am
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>
<% } %>
by Jerry Nixon   March 05, 2010 @ 9:32am
Tags: C#, AJAX, MVC
608 Views
no comments
 
C#
//
// GlossaryController.cs
 
public ActionResult Index()
{
    return View(Models.Term.SelectAll());
}
 
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(FormCollection collection)
by Jerry Nixon   March 05, 2010 @ 9:29am
Tags: C#, AJAX, MVC
510 Views
no comments
 
C#
// LivePreviewPlugin.cs
//
 
using System;
using System.Collections;
using System.Html;
using System.Runtime.CompilerServices;
using jQueryApi;
 
[Imported]
by Nikhil Kothari   February 25, 2010 @ 11:25am
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);
by yuyu1984   January 10, 2010 @ 10:24pm
272 Views
no comments
 
C#
 
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');
        });
    });
}
by Paul   September 29, 2009 @ 3:55pm
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);
by Rick Strahl   September 11, 2009 @ 6:43pm
489 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate