Hi Serhat,

Thanks for the reply.

Well, I've gone through the code and I'm using just the same code. I
went through the code again and again but it wasn't working.
Afterwards, I decided to test it on different browsers and it worked
in IE 8, but it didn't work in FF 3.5, Chrome.

Here is the exact code I'm using...

function sendVerification()
        {
                var ajax_load = "<img src='loader.gif' alt='loading...' />";
                var callBackURL = 
"http://localhost:50127/ajax/requestCallback.axd";;
                var callBackOptions = {mobile: $("#txtNumber").val(), action: 
'0'};
                var hiddenHTML = "<input type=\"hidden\" id=\"hMobile\" 
value=\"" + $
("#txtNumber").val() + "\" />"
                $("#dvVerifyStatus").append(hiddenHTML);
                $("#dvMobileNumber").html(ajax_load);
                $.get(callBackURL, callBackOptions, function(d){
                        if(d.indexOf("|") > 0)
                        {
                                var data = d.split("|");
                                if(data[0]=="True")
                                {
                                        $("#dvMobileNumber").html(data[1]);
                                }else
                                {
                                        alert(data[1]);
                                }
                        }
                },"html");
        }

I don't know why this is not working but it's really worrying me. I
also checked the code in FireBug using Net console, it displays zero
bytes for response while when I try to access the same url in a new
tab, it displays the text.

Please help.

On Nov 14, 2:51 am, serhat <serhatsarika...@gmail.com> wrote:
> It works for me, the code is:
>
> $.get('ajax_try.php',{data1: 'data1-text', data2: 'data2-text'},
>         function(ajax_response){
>                 if(ajax_response=='ok'){
>                         document.myForm.submit();
>                 }else{
>                         $('#response_text_field').html(ajax_response);
>                 }
>
> });
>
> it returns 'ok' and submits the form if validation success on the ajax
> page, else it returns text for each wrong element value. You can add
> all data with;
>
> var data[i] = $('#element_need_to_validate').val();
>
> wish this helps.
>
> On 13 Kasım, 23:10, Mayank <lone....@gmail.com> wrote:
>
> > I have a page that uses a jquery $.get() method to retrieve content
> > from a remote page.
>
> > Ex
>
> > $(function(){
> >    $.get("http://domain.com/script.axd",{parameter1: "value1",
> > parameter2: "value2"}, function(responseText){
> >       alert(responseText);
> >    });
>
> > });
>
> > The above script returns a null or empty string even though the called
> > page is returning "True" or "False" as string string.
>
> > Thanks for help in advance.

Reply via email to