Showing posts with label Ajax. Show all posts
Showing posts with label Ajax. Show all posts

Tuesday, 16 April 2013

Ajax request to cross domain web service

Here http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=wbp-3BJWsU8&format=json is an example URL

$.ajax({
            url: 'http://query.yahooapis.com/v1/public/yql',
                data: {
                    q: "select * from json where url ='http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=wbp-3BJWsU8&format=json'",
                    format: "json"
                },
                dataType: "jsonp",
            success: function (data) {

                alert(JSON.stringify(data));


            },
            error: function (result) {
                alert("Sorry no data found.");
            }
        });

Friday, 12 April 2013

jquery ajax call to partial view in MVC3

$.ajax({
    type: "Get",
    url: "/User/ResetPassword/",
    success: function (data) {
        $("#divId").html(data);
    }
});