tags:

views:

29

answers:

1

This is my code. When I run this I get an error: "Ajax is undefined". The error line is highlighted by black letters.

function funGetName()
{
    var id=document.getElementById("Cust_Id").value;
    var URL="Default.aspx?TODO=getName&custId="+id;
    alert(id);
    var ajax=new Ajax.Request(URL,
    {
        method:'get'
    });
}
A: 

Try putting the opening brace on the same line, after URL,. It may be a semicolon insertion problem.

i.e.:

var ajax=new Ajax.Request(URL, {
    method:'get'
});
Skilldrick
@skilldrick: it's not working
saj
even if i comment all the lines except var ajax=new Ajax.Request() i got the same error. so might be from hardware components like versions: i'm using vs 2005 version 8.0 framework 2.0
saj