This is a discussion on ajax return undefined within the JavaScript Programming forums, part of the Programming & Scripting category; hi i m using ajax like this Code: var sTarget = 'EmergencyDocCreation_CheckForInvoiceDuplicate.asp'; sTarget += '?SupplierID=<%=lSupplierID%>'; sTarget += '&DocumentRef=' + escape($('txtDocumentRef').value); ...
| |||||||
|
#1
| ||||
| ||||
| hi i m using ajax like this Code: var sTarget = 'EmergencyDocCreation_CheckForInvoiceDuplicate.asp';
sTarget += '?SupplierID=<%=lSupplierID%>';
sTarget += '&DocumentRef=' + escape($('txtDocumentRef').value);
sTarget += '&DocumentDate=' + escape($('txtDocumentDate').value);
sTarget += '&ValueExclVAT=' + escape($('txtDocumentExclVAT').value);
//Check for duplicate invoice
var ajaxRequest = new Ajax.Request(sTarget,
{
evalScripts: true,
asynchronous: false
}
);
alert(ajaxRequest.responseText); Code: 'Get parameters from the querystring
lSupplierID = CLng(Request.QueryString("SupplierID"))
sDocumentRef = Request.QueryString("DocumentRef")
sDocumentDate = Request.QueryString("DocumentDate")
sValueExclVAT = Request.QueryString("ValueExclVAT")
'Response.ContentType = "text/javascript"
Response.write "<script type=""text/javascript"">alert('hello');</script>"
Response.End
what i m missing?? thanks
__________________ Love is physical attraction and mental destruction |
|
#2
| ||||
| ||||
| What exactly are you trying to do with this? Why use AJAX to display a JavaScript alert?
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.If you like it here...throw us a few bones to help support us. Join our Folding team: DeveloperBarn Folding |
|
#3
| ||||
| ||||
| actaully i m checking my ajax code is working or not . |
|
#5
| ||||
| ||||
| see i m calling asp file with query string .i m calling this way Code: var sTarget = 'EmergencyDocCreation_CheckForInvoiceDuplicate.asp';
sTarget += '?SupplierID=<%=lSupplierID%>';
sTarget += '&DocumentRef=' + escape($('txtDocumentRef').value);
sTarget += '&DocumentDate=' + escape($('txtDocumentDate').value);
sTarget += '&ValueExclVAT=' + escape($('txtDocumentExclVAT').value);
//Check for duplicate invoice
var ajaxRequest = new Ajax.Request(sTarget,
{
evalScripts: true,
asynchronous: false
}
);
hope it make some sense. |
|
#6
| ||||
| ||||
| Take a look at the AJAX tutorial here: Ajax Tutorial - XMLHttpRequest Unless I'm missing something or not understanding something, I don't see where you are Opening the request to the specified page. |
|
#7
| ||||
| ||||
| here i m opening request.i dont want to use xmlhttp request. var ajaxRequest = new Ajax.Request(sTarget, { evalScripts: true, asynchronous: false } |
|
#8
| ||||
| ||||
| Okay, just to warn you, my custom AJAX is far from great...but what happens with something like this: Code: var url = ''EmergencyDocCreation_CheckForInvoiceDuplicate.asp'
url += '?SupplierID=<%=lSupplierID%>';
url += '&DocumentRef=' + escape($('txtDocumentRef').value);
url += '&DocumentDate=' + escape($('txtDocumentDate').value);
url += '&ValueExclVAT=' + escape($('txtDocumentExclVAT').value);
url = encodeURIComponent(url);
new Ajax.Request(url, {
method: 'get',
evalJS: true,
asynchronous: false,
onSuccess: function(transport) {
// Alert on success
alert('Hello World');
}
});
|
|
#9
| ||||
| ||||
| object expected error.when i put your code as it is.did u run at your end. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| triple combo ajax | dragon rider | ASP Development | 0 | October 16th, 2008 04:34 PM |
| .Net And Ajax | smithcarvo | .Net Development | 2 | August 20th, 2008 07:50 AM |
| Return Default Date If Null | jmurrayhead | SQL Development | 16 | June 8th, 2008 10:30 PM |
| Using AJAX Auto Complete Extender with Database | richyrich | .Net Code Samples | 0 | March 26th, 2008 07:59 AM |
| Dynamic Content in AJAX Extender | richyrich | .Net Development | 3 | March 17th, 2008 12:14 PM |