Jörn,

The $("[EMAIL PROTECTED]", xml); returned an object, but $("[EMAIL PROTECTED]",
xml).val(); returned 'null' value...

When I put above line in HTMLTestPage.htm it worked. It seems that $( does
not see an 'xml' variable content.



Jörn Zaefferer wrote:
> 
> Sasha Oros schrieb:
>> Hi,
>>
>>
>> I'm trying to use an ajax post request and not sure why is not working.
>>
>>
>> Code in a button:
>>
>> $.post(      "HTMLTestPage.htm",
>>      {
>>             employeeID: "007",
>>             requestType: "R"
>>      },
>>      function(xml){
>>              alert( xml );
>>              alert( "BankName = " + $("#BankName", xml).val() );             
>>                                 
>>      }
>> );   
>>
>>
>> The 'HTMLTestPage.html' is an html page (not xml). When I click on the
>> button the first alert returns the whole page and I can see the source
>> code,
>> id=BankName and value for the field, but the second alert returns an
>> empty
>> string. I tried using the text() and html() function, but the outcome was
>> the same.
>>
>> By the way, when I created a test button on the 'HTMLTestPage.html' with
>> 'alert( $("#BankName" ).val()' it worked and I got the value displayed.
>>   
> HTML or XML returned by $.post or the other AJAX methods do not provide 
> a getElementById selector. You need to use other selectors or use 
> $([EMAIL PROTECTED], xml).
> 
> -- 
> Jörn Zaefferer
> 
> http://bassistance.de
> 
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Cannot-retrieve-%24.post%28-%29-response-tf2861724.html#a7996894
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to