Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi every one
am getting the follwing url
https://localhost:1443/home/login?jsoncallback=?

and am passing these url as parameter to getJSON method in jquery but action was not calling from home controller

am placing my jquery code please check it once send me the solution

C#
function runFunctionIfAvailable(callback, params) {
        try {
            if (typeof callback !== 'undefined') {
                if ($.isFunction(callback)) {
                    if (params !== null) {
                        return callback(params);
                    } else {
                        return callback();
                    }
                } else if (typeof callback === 'string') {
                    var f = new Function(callback);
                    if (params !== null) {
                        return f.call(params, params);
                    } else {
                        return f();
                    }
                }
            }
        } catch (e) {
            return false;
        }
    };




try {
                $.getJSON(
                  url,
                    function (data) {
                  
                        runFunctionIfAvailable(onSuccessCallback, data);
                    })
                    .error(function () {

                        runFunctionIfAvailable(onErrorCallback, null);
                    })
                    .complete(function () {
                        /* This is extra protection. Response automatically removes jsonp request cookies. */
                        clearCookies(added);

                        runFunctionIfAvailable(onCompleteCallback, null);
                    });
            }
Posted
Updated 30-Apr-15 20:18pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900