Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

Wednesday, 10 September 2014

JQuery AJAX call for web services / jsp / asp.net page

with out data 
       $.ajax({
            type: "POST",
            url: " web services / jsp / asp.net page",
            dataType: "text",
            async:false,
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                Success = true;//doesnt goes here
            },
            error: function (textStatus, errorThrown) {
                Success = false;//doesnt goes here
            }

        });
with passing data on server
        $.ajax({
            type: "POST",
            url: " web services / jsp / asp.net page",
            dataType: "text",
            async:false,
            data: JSON.stringify({ json object }),

            contentType: "application/json; charset=utf-8",
            success: function (data) {
                Success = true;//doesnt goes here
            },
            error: function (textStatus, errorThrown) {
                Success = false;//doesnt goes here
            }

        });

            

Working with checkbox with JQuery

Vereion 1.6 +
$('#myCheckbox').prop('checked', true);
Vestion 1.5
$('#myCheckbox').attr('checked', true);

Conver JSON object to String in JQuery

JSON.stringify(jsonObject);

Jquery Input button enable / disable

version 1.6 + 

$("input").prop('disabled', true);
version 1.5 
$("input").attr('disabled','disabled');