I have this script but nothing happen,can someone tell me what is wrong?i want to make a chat room but nothing is happen,when i press the button is stack,can someone tell me what is wrong and give me a detail about what should i do?Or someone give me another detail,please excuse me about this long post but here i cant write less details,thank you in advance
<?
//include("write_chat.php");
$rid = $_GET["rid"];
echo "<div id='postResults'></div>";
?>
<script>
//inregistrare postare
$('body').on('submit', '#contact-form', function(){
$.post('index.php?page=writechat&rid=".$_GET["rid"].", $(this).serialize(), function(resp){
alert(resp);
});
return false;
});
//afisare la interval de timp
setInterval(function(){
$('#content').load(index.php?page=writechat&rid=".$_GET["rid"]');
}, 5000);
(function($)
{
$(document).ready(function()
{
$.ajaxSetup(
{
cache: false,
beforeSend: function() {
$('#content').hide();
$('#loading').show();
},
complete: function() {
$('#loading').hide();
$('#content').show();
},
success: function() {
$('#loading').hide();
$('#content').show();
}
});
var $container = $("#content");
$container.load("<?php echo "index.php?page=writechat&rid=".$_GET["rid"].""; ?>");
var refreshId = setInterval(function()
{
$container.load('<?php echo "index.php?page=writechat&rid=".$_GET["rid"].""; ?>');
}, 5000);
});
})(jQuery);
</script>
<body>
<div id ="content"></div>
<form id="contact-form" class="bl_form text-center" action="<?php echo "../../index.php?page=writechat&rid=$rid"; ?>" method="post" novalidate>
<span class="field-wrap scrollimation fade-
right">
</span>
<span
class="field-wrap scrollimation fade-left">
<textarea id="contact-message"
name="message" rows="5" class="label_better requiredField" data-new-
placeholder="Message" style="margin: 0px; width: 1210px;
height: 88px;" data-error-empty="<?php echo "$insert_message"; ?>"></textarea>
</span>
<p class="text-center"><button name="sy2"
id="submit_post" type="submit" class="btn btn-sm btn-primary icon-left" data-error-
message="Error!" data-sending-message="Sending..." data-ok-message="Message Sent"><i
class="fa fa-paper-plane"></i>Send Message</button></p>
<input type="hidden" name="submitted"
id="submitted" value="true" />
<?php echo "<postfield name=\"message\"
value=\"$(message)\"/>"; ?>
</form>
</body>