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
LVL 1
tjyoungAsked:
Who is Participating?
 
Kiran SonawaneConnect With a Mentor Project LeadCommented:
Just for debugging. Try with absolute url like

$.post("http://www.whateverdomain.com/application/modules/account/scripts/start_social.php",{ account_id:"<?=$account_id;?>", campaignstartmessage:$("#campaignstartmessage").val(),twitter:$('#twitter:checked').val(),facebook:$('#facebook:checked').val() } ,function(data)
0
 
tjyoungAuthor Commented:
Trying...
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Kiran SonawaneProject LeadCommented:
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)
  {
   
  }
});
0
 
tjyoungAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.