Link to home
Start Free TrialLog in
Avatar of tjyoung
tjyoung

asked on

Appending a variable on a .post in jquery. Must be doing it wrong?

Hi,
I'm guessing I'm adding my account_id variable wrong in this post using jquery. I see the php is working fine (the variable appears). I'm just thinking I have a syntax error somewhere in the url:

 
$.post("application/modules/account/scripts/start_social.php",{ account_id:"<?php echo $account_id;?>", campaignstartmessage:$("#campaignstartmessage").val(),twitter:$('#twitter:checked').val(),facebook:$('#facebook:checked').val() } ,function(data)

Open in new window


Any idea where I'm incorrect?

This is what it looks like prior to posting it:

 
$.post("application/modules/account/scripts/start_social.php",{ account_id:"4", campaignstartmessage:$("#campaignstartmessage").val(),twitter:$('#twitter:checked').val(),facebook:$('#facebook:checked').val() } ,function(data)

Open in new window


See anything?

Thanks tj
SOLUTION
Avatar of chaitu chaitu
chaitu chaitu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Kiran Sonawane
Kiran Sonawane
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tjyoung
tjyoung

ASKER

Trying...
Seems there is syntax error

$(document).ready(function(){
  $.post("application/modules/account/scripts/start_social.php",
  { account_id:"<?=$account_id;?>", campaignstartmessage:$("#campaignstartmessage").val(),twitter:$('#twitter:checked').val(),facebook:$('#facebook:checked').val() } ,
  function(data)
  {
   
  }
});
Avatar of tjyoung

ASKER

It was a typo on the receiving script. There goes 2 hours of my life I'll never get back. Thank you very much for your responses though. They are good references regardless.