Am codul asta dar nu imi merge,adica nu se intampla nimic
Cod: Selectaţi tot
<div id ="content"></div>
<form id="contact-form" class="bl_form text-center" action="<?php echo
"writechat/room/".$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>
<script>
//inregistrare postare
$('body').on('submit', '#contact-form', function(){
$.post('writechat/room/".$rid."', $(this).serialize(), function(resp){
alert(resp);
});
return false;
});
//afisare la interval de timp
setInterval(function(){
$('#content').load('writechat/room/".$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 "writechat/room/".$rid."";
?>");
var refreshId = setInterval(function()
{
$container.load('<?php echo "writechat/room/".$rid.""; ?>');
}, 5000);
});
})(jQuery);
</script>
adica daca apas butonul submit nu merge,ramane pe loc,e ceva ce am omis?
Edit:
E din htacccess,nu ma lasa sa postez folosind linkul
ci doar pe asta
Cod: Selectaţi tot
http://legacy-cms.ro/index.php?page=chatroom&rid=2
in htaccess am asa
Cod: Selectaţi tot
Options +FollowSymLinks
RewriteEngine On
Options -Indexes
RewriteRule ^([A-z0-9_-]+)$ index.php?page=$1 [NC,L]
RewriteRule ^([A-z0-9]+)/room/([0-9]+)$ index.php?page=$1&rid=$2 [NC,L]
vreo idee de ce, sau cum se poate repara?
adica nu imi da voie sa folosesc instant post prin ajax sau sa pun ajax cu setintervar din alta pagina.