[英]javascript working fine in localhost but not on live server
i have a comment system in php,ajax and javascript this code used to work fine in localhost but when i transfered my website to live server it does not work idk why this is my script 我在php,ajax和javascript中有一个注释系统,该代码曾经在localhost中可以正常使用,但是当我将网站转移到实时服务器时,它不起作用idk为什么这是我的脚本
<script type="text/javascript">
$(document).on('click','.submit',function(e){
e.preventDefault();
$post = $(this);
var username2 = $(this).parent().find("#username").val();
var comment2 = $(this).parent().find("#comment").val();
$commentsec = $(this).closest("form").next(".comments");
//Get values of input fields from DOM structure
var dataString = {
id: $(this).parent().find("#id").val(),
username: $(this).parent().find("#username").val(),
uid: $(this).parent().find("#uid").val(),
comment: $(this).parent().find("#comment").val()
};
//Get values of input fields from DOM structure
$.ajax({
url:'comments.php',
data:dataString,
success:function(){
$commentsec.append('<p class="written"><a href="users.php?id= <?php echo $id3; ?>"><b style=color:black !important>'+username2+'</b> </a>'+comment2+"</p>"+'<div class="dropdown"><img src="images/ellipsis.png" class="dots"><div class="dropdown-content"><br><p class="delete" data-delete=<?php echo $commentid; ?>">delete</p></div></div>');
$(" #comment").val("");
}
});
});
is there any way i can get error in my error log?? 有什么办法可以在错误日志中得到错误?
this is my network tab network tab 这是我的网络标签网络标签
For you php error check 为您的PHP错误检查
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
You can check any kind of your javascript error by inspect your browser and go to your console and debug with console.log 您可以通过检查浏览器来检查任何类型的javascript错误,然后转到控制台并使用console.log进行调试
Hope this will help you 希望这个能对您有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.