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 jQuery Ajax
//start processing
var api = new moviesApi();
api.getRatings({
    success: function (result) {
        for (var i = 0; i < result.length; i++) {
            //new Option(text, value)
            var option = new Option(result[i].ID, result[i].Name);
            $('#ratings').append(
                $('<option></option>').val(result[i].ID).html(result[i].Name)
            );
23 Views
no comments
 
//Create and type variable
var moviesApi = function () { }
 
moviesApi.prototype.getRatings = function (options) {
    $.ajax({
        url: applicationUrl + '/Api/movies/getratings',
        type: 'GET',
        success: options.success,
        error: function (result) {
            displayError(result);
by Warren Wiltshire   May 02, 2012 @ 5:19am
32 Views
no comments
 
//Make sure the calls aren't cached
$.ajaxSetup({ cache: false });
 
//Populate Manufacturer dropdown list
$("#ddlManufacturers").empty();
$.getJSON("/Common/Manufacturer/List", null, function (result) {
  //Add each list item to the dropdown list
  $.each(result, function (key, val) {
    $('#ddlManufacturers').append(new Option(val.Name, val.Id));
  });
by Warren Wiltshire   April 30, 2012 @ 2:30pm
28 Views
no comments
 
//Make sure the calls aren't cached
$.ajaxSetup({ cache: false });
 
$('.pressureDir').each(function (idx, elem) {
   var id = elem.innerText.trim();
   //console.log(elem.nodeName + ' ,' + elem.innerText + ', ' + id);
   $.getJSON("/Common/Pressure/Detail/" + id, null, function (result) {
     elem.innerText = result;
   });
});
by Warren Wiltshire   April 30, 2012 @ 2:27pm
32 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
131 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
423 Views
no comments
 
$.ajaxSetup({ cache: false });
$("#loading_animation").bind({
    ajaxStart: function() { $(this).show(); },
    ajaxStop: function() { $(this).hide(); }
});
by jaredmroberts   January 28, 2011 @ 1:00pm
617 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