Ajax Troubleshooting

i’m just getting into custom coding in ajax… fun as hell by the way…

my current problem is i don’t know what exactly is getting passed through httprequests. is there a firefox tool that shows what is getting passed?

also… can i put php script into javascript?

i have 2 methods going on … i wanted to test if php will work in the javascript… other method is just to grab the id from a hidden value.

function showprice(str, prodID)

var str=document.CalculateForm.txtqty.value; 
var prodID=document.CalculateForm.txtprodID.value; 

if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
xmlhttp.open("GET","/getprice.php?q="+str+"pid="+<?= $productID; ?>,true);


I use jQuery as my JS library… if you are interested you can take a look at their AJAX methods.


They are well documented and easy to use.