I just did this with following code:

$(document).ready(function(){
            $("a").click(function(event){

            event.preventDefault();

            $.ajax({
            url:"https://ondemand.abc.com/xyz/sessionServlet";,
            success:function(results)
                    {
                        $("#time").val(results);
                    }
            });
                        });
                       });

What you say on this?

On Oct 9, 4:11 pm, Nits <nitesh.ja...@gmail.com> wrote:
> Also I have to invoke this script on click of the link on the
> page...how can I do it...
>
> On Oct 9, 3:35 pm, "Jeffrey Kretz" <jeffkr...@hotmail.com> wrote:
>
>
>
> > This would be one way of doing that with jQuery:
>
> > $.ajax({
> >    url:"https://ondemand.abc.com/xyz/sessionServlet";,
> >    success:function(results){$("#time").val(results);}
>
> > });
> > -----Original Message-----
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> > Behalf Of Nits
> > Sent: Friday, October 09, 2009 12:56 PM
> > To: jQuery (English)
> > Subject: [jQuery] XMLHttpRequest in jQuery
>
> > I have the following piece of code for XMLHttpRequest. I want to write
> > the jQuery equivalent for the same. Since I am new to jQuery, any help
> > would be great!!
>
> > <body>
> > <script type="text/javascript">
> > function ajaxFunction()
> > {
> > var xmlhttp;
> > xmlhttp=new XMLHttpRequest();
> > }
> > xmlhttp.onreadystatechange=function()
> > {
> > if(xmlhttp.readyState==4)
> > {
> > document.form1.time.value=xmlhttp.responseText;
> > }
> > }
> > xmlhttp.open("GET","https://ondemand.abc.com/xyz/sessionServlet
> > ",true);
> > xmlhttp.send(null);
> > }
> > </script>
>
> > <form id="form1" runat="server">
> > <div>
> > Name: <input type="text" name="username" onkeyup="ajaxFunction();" />
> > Time: <input type="text" name="time" />
>
> > </div>
> > </form>
> > </body>
>
> > And when I run my application and type something in the textbox, i get
> > the following value in the adjacent ones'
> > <html><script> window.location = 'http://localhost/sso/signonServlet?
> > sessionID=7777643267726466939704344537951412a2a';</script></html>- Hide 
> > quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Reply via email to