Tuesday, July 5, 2011

Pass external data into $.ajax success function

TaskList.prototype.GetNumTasks = function(userID) {
            var apple = this.AppID;
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf=8",
                data: "{username:'" + escape(userID) + "', wsUrl:'" + this.WSUrl + "', appType:'" + this.AppType + "'}",
                url: WorkboxServiceURL + "/GetNumTasks",
                dataType: "json",
                success: function(data) {
                    alert(data.d);
                    alert(apple);
                },
                error: function() {
                    alert("error");
                }
            });
        }

No comments:

Post a Comment