tags:

views:

109

answers:

3

How can you use POST in this command?

var answer = $('#answer').val();
jQuery('div.answer_' + answer + ' a.delete_answer')
               .live('click', function(){

This should match this

 div.answer_answerExample a.delete_answer
+2  A: 

$.POST is a function not a variable that you can concatenate with strings. I don't understand what are you doing but you can't do it in this way. If yuo explain me better what you're tryng to do i can give you my help.

mck89
I clarified my question.
Masi
+1  A: 

You are completely misusing the post function. What I believe you meant to do is this.

$('div.answer_' + $('#answer').val() + 'a.delete_answer')

On a side note JavaScript is case-sensitive and calling $.POST would also throw object not found error.

See the jQuery Docs for further reference.

http://docs.jquery.com/Ajax/jQuery.post

ChaosPandion
fixed these problems
Masi
+2  A: 

you need to fetch the result from post into some variable then you can use it in your code as follows (from jquery page):

var anaswer;
$.post("YOUR_PAGE", ,
  function(data){
    alert(data.answer); 
    answer = data.answer;
  }, "json");
TheVillageIdiot