Reputation: 3378
A question mark shows up at the top of the page but I can't find it. I'm simply trying to send a test email from a batch of emails to verify the content.
<script type="text/javascript">
$(document).ready(function () {
$(function() {
$("#message_submit").live('click', function() {
alert('x');
$.ajax({
type: 'GET',
url: 'cfc/basic.cfc?method=SendTestEmail',
data: 'EmailAddress=' + $("#previewemailaddress").text() + '&emailbody=' + $("#Email_Text").text() + '&emailfrom=' + $("#email_from").text(),
error: function (xhr, textStatus, errorThrown) {
// show error
alert(errorThrown);
},
success: function () {
return true;
}
});
return false;
});
});
)};
<table width="900">
<tr>
<td width="900"><cftextarea name="Email_Text" id="Email_Text" value="#Qmailer.Email_Text#" richtext="True"></cftextarea>
</td>
</tr>
<tr>
<td>
<p><label for="previewemailaddress">Email Address for test email</label><input type="text" size="30" name="previewemailaddress" id="previewemailaddress" /></p>
<p><input type="button" value="Send Test Email" name="commit" id="message_submit"/></p>
</td>
</tr>
</table>
Upvotes: 0
Views: 775
Reputation: 23537
Your last line should be });
instead of )};
.
A bit of an explanation: the error has nothing to do with jQuery. What you had there is an invalid JavaScript syntax. In the future just open your browser's JavaScript console to check for errors.
You can have a look at it here.
Upvotes: 3
Reputation: 55750
You ending tag for your DOM ready event was a illegal character.. Try removing that
});
});
}); < -----
Your code was ending with )};
Also check what error you see in the console section of your browser
Upvotes: 1