Isn't that pretty much simple in your code? jQuery is a library over JavaScript, not a built-in function. You need to first make sure that now jQuery is going to run, you need to handle the document.ready function and then trigger the jQuery code there. You've efficiently written the code to
include the library, but not
run the library. Edit your code, and write it this way,
function postContactToGoogle(){
$(document).ready(function() {
var dryrun = $('#DryRun').val();
$.ajax({
url: "https://docs.google.com/forms/d/1iHuOmQx0hXKH6DGb2GNUc-yu-0Iiv9PDkKPgAXX3Ldc/formResponse",
data:{
"entry_1438934548"
}
type: "POST",
dataType: "xml",
statusCode: {
0:function () {window.location.replace("ThankYou.html");},
200: function () {window.location.replace("ThankYou.html");}
}
});
}
});
Now once you would execute it, the code would run. Until now, the console would have shown "$ is not defined". Anyways, a good approach to using jQuery is, to write all of your code inside a document.ready handler.
$(document).ready(function () {
});
Then all of your code would be managed the jQuery way. $ is defined in the jQuery.