Using jquery statement within a jquery data object

Posted by richardverbruggen on Stack Overflow See other posts from Stack Overflow or by richardverbruggen
Published on 2010-05-01T14:55:33Z Indexed on 2010/05/01 14:57 UTC
Read the original article Hit count: 111

Filed under:

As part of a jquery function u use this ajax post statement to get some reaction from a server. I want to pass some arguments to my test page. But these must be variables and are declared on the previous lines (iid and inst)

How can i put these variables within the data object marked with the XX?

iid = $(this).attr('iid');
inst = $(this).attr('inst');
$.post("test.php", { inst: XX, iid: XX},function(data){
      alert("Data Loaded: " + data);
    });

© Stack Overflow or respective owner

Related posts about JavaScript