whose2know
Board Regular
- Joined
- May 1, 2002
- Messages
- 59
I'm still stuck trying to pass a website click from VBA. I think I've inlcuded the portion of the code below that is related to selecting the account. Any help on how I pass the proper variables through to ie and then "click"?
PHP:
function SelectAccount(id) {
var params = JSON.stringify({ accountNumber: id });
$.ajax({
type: "POST",
url: "SelectAccount2.aspx/SelectAccount",
data: params,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
if (response.d) {
var returnURL = GetURLParameter("ReturnURL");
if (returnURL === "") {
var path = ****************.pathname.split('/');
path[path.length - 1] = "Billing.aspx";
var newPath = path.join('/');
var location = String.format("{0}//{1}{2}", ****************.protocol, ****************.host, newPath);
returnURL = location;
}
else {
returnURL = unescape(returnURL);
}
****************.href = returnURL;
}
},
error: function(XMLHttpRequest) {
var response = JSON.parse(XMLHttpRequest.responseText);
if (response.Message) {
DisplayMessage(response.Message);
}
else {
DisplayMessage("An unknown error occured when selecting the account.");
}
}
});
}