Trying to get an HTTP post to work with jquery
I am having difficulties getting the following code to run. When looking at the network, I see the http post actually happening, but none of the arguments are being sent across the wire. What am I doing wrong??
<html>
<body>
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
<script>
google.load("jquery", "1.4.1");
$(function() {
var dat = "{\"var1\":\"variable\",\"var2\":\"variable\",\"var3\":\"variable\",\"var4\":300}";
alert("I am about to POST this:\n\n" + dat);
$.post(
"http://thisismyurl",
dat,
function(data) {
alert("Response: " + data);
},
"json");
});
</script>
</body>
</html>