Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#message,#name").live("keydown", function (e) {
- if (e.keyCode === 13 && e.ctrlKey) {
- $(".submit").trigger('click');
- e.preventDefault();
- }
- });
- $('.submit').live('click',function() {
- var name = $('#name').val();
- if (!name || name == 'Name') {
- alert('Please enter your name');
- return false;
- }
- var form_data = {
- app_id:<?php echo $this->uri->segment(3)?>,
- name: $('#name').val(),
- email: $('#email').val(),
- message: $('#message').val(),
- ajax: '1'
- };
- $.ajax({
- url: "<?php echo site_url('comment/comments_insert'); ?>",
- type: 'POST',
- data: form_data,
- success: function(msg) {
- fx.boxout(event);
- alert("dd");
- $("<div>发送成功</div>").addClass("notify").appendTo("body").fadeOut(8000);
- $("<li><span class='author'>" + form_data["name"].replace("<","") + "</span>" + form_data["message"].replace("<","") + "</li>")
- .prependTo(".comment_list ul").effect("highlight",{},5000);
- },
- beforeSend: function(data){
- $(".modal-window").html('<p>Loading...</p>');
- }
- });
- return false;
- });
Add Comment
Please, Sign In to add comment