View Single Post
Old 01-30-2013, 05:11 PM   PM User | #3
JohnGalt
New to the CF scene

 
Join Date: Jan 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
JohnGalt is an unknown quantity at this point
@DanInMa

Good thinking,
here goes the Output on the client side:
Code:
<p id="notify">Notify</p>		

...
	<script>
		$("#notify").click(function(){
			$.ajax({
				type: "POST",
				url: "/.../sendEmail.php",
				data: "{ 'body': 'TEST', 'to': 'CorrectEmailHere', 'from': 'CorrectEmailHereAsWell', 'subject': 'Test' }",
				dataType: "text",
				complete: function (transport) {  if (transport.status == 200) $("#notify").html("Success"); else alert("Please try again later"); }
			});
			return false;
		});
	</script>
Hope this helps solving my problem.

Will take a look at the error handling thing also, thanks for that!
JohnGalt is offline   Reply With Quote