You forgot to put a

$(document).ready(function(){

});

Around your code.

--John

On 10/19/07, VJ <[EMAIL PROTECTED]> wrote:
>
> I am unable to get the ajax to work in jquery.
> Whenever i pass a .php url to $.ajax. it does not return and none of
> the callbacks are executed. It justt hangs with no error.
>
> It looks very smple but does not seem to work..
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1" />
> <script language="javascript" src="jquery-1.2.1.js"></script>
> <title>Untitled Document</title>
> </head>
>
> <body>
> <a href="javascript:void(0);">Click here to send email</a>
> </body>
> <script language="javascript">
> $("a").click(function() {
>                                                 alert("about to send");
>                                                 $.ajax({
>                                                   type: "GET",
>                                                   url: 
> "http://129.219.208.31/email/email.php?
> [EMAIL PROTECTED]&subject=hi&body=hellofrompage",
>                                                   error:function(msg) { 
> alert(msg); }
>                                                 });
>
> });
> </script>
> </html>
>
>

Reply via email to