【发布时间】:2023-03-23 19:02:01
【问题描述】:
我得再问一问。这是我的java脚本代码
<script>
$('#spiele').on('change', function(e){
console.log(e);
var spielID = e.target.value;
//ajax
$.get('/spieler-table?spielID=' + spielID, function(data){
//success data
console.log(data);
});
});
</script>
一切正常。 但是在我的路由网络中出现错误。
jquery-3.2.1.min.js:4 GET http://localhost:8000/spieler-table?spielID=3 500 (Internal Server Error)
这里是……
Route::get('/spieler-table', function(){
$testvar = Input::get('spielID');
echo $testvar;
});
我认为这是因为 var spielID 来自我的 javascript 代码。 因为我进入了 Route get 并且 php echo 可以通过简单的字符串输出正常工作。但是当我尝试将 spielID 输入测试仪时。我得到了错误。我正在使用 laravel 框架
【问题讨论】:
-
打开错误日志并阅读详细的错误描述。
-
在哪里可以找到错误日志?
-
转到localhost:8000/spieler-table?spielID=3 查看错误。如果您看不到任何错误,而只是“500 错误”或 smt.编辑您的 .env 文件并将 DEBUG 设置为 true。如果仍然看不到错误,请尝试在 php.ini 中将 display_errors 设置为 on。您的应用程序日志位于
storage/logs
标签: javascript php laravel input