problem with $.post
problem with $.post
Ok, so my $.post ajax query isn't going through and I can't figure out why. I've cut out almost everything, and boiled it down to only a really basic function, but still nothing. Here is the Client Side code:
<html>
<head>
<script type="text/javascript" src="jquery-1.4.2.js"></script>
<script type="text/javascript">
function cstarter()
{
window.einterval = setInterval("cst()", 5000);
window.big = "hi";
}
</script>
<script type="text/javascript">
function cst()
{
$.post("testback.php", { csize: window.big },
function(theXML){
$('label',theXML).each(function(i){
window.creply = $(this).find("numb").text();
window.cnumb = $(this).find("rep").text();
});
$('.inner').append(window.creply);
$('.inner').append(window.cnumb);
}
);
}
</script>
</head>
<body>
<div class="inner" >
</div>
<script type="text/javascript">
cstarter();
</script>
</body>
</html>
And here is the serverside code:
<?php header('Content-Type: application/xml; charset=ISO-8859-1')?>
<?php
$cnumb = $_POST["csize"];
$ccrank = "$cnumb"."bye";
$ctest = "yeahhh";
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
<label>
<rep>$ccrank</rep>
<numb>$ctest</numb>
</label>
";
?>
Sorry about the mess, as I said it's a chopped up version of something much bigger. Anyway, any input would be much appreciated. Thanks.