|
-
May 31st, 2012, 03:47 PM
#11
Re: xmlHttpRequest.Send() issues.
Code:
function getResponse() {
var currentDate = new Date();
var sendMessage = JSON.stringify({
SendTimestamp: currentDate,
Message: "Message 1"
});
$.ajax({
type: "POST",
url: "http://L45723:1802/?callback=testcallback",
data: sendMessage,
contentType: "application/json",
beforeSend: function(xhr) {
xhr.setRequestHeader("Authentication", "Basic " + $.encodeBase64("server:server123")); //May need to use "Authorization" instead
},
success: function(data){
$('#_receivedMsgLabel').append(data.Message + '<br/>');
getResponse();
}
});
}
Changed my code to as above...as in the link, but don't think I understood it because I got this in Firefox:
$.encodeBase64 is not a function
beforeSend(xhr=Object { readyState=0, setRequestHeader=function(), getAllResponseHeaders=function(), more...})ShowComet9.aspx (line 39)
ajax(url=undefined, options=Object { type="POST", url="http://L45723:1802/?callback=testcallback", data="{"SendTimestamp":"2012-...,"Message":"Message 1"}", more...})jquery-1.7.1.js (line 7547)
getResponse()ShowComet9.aspx (line 41)
()ShowComet9.aspx (line 56)
[Break On This Error]
...thentication", "Basic " + $.encodeBase64("server:server123")); //May need to use...
Where do I get the encodeBase64 jQuery function from?
Last edited by PeejAvery; May 31st, 2012 at 04:32 PM.
Reason: Added code tags
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|