gpt4 book ai didi

javascript - Laravel 中未显示弹出按钮

转载 作者:行者123 更新时间:2023-12-03 03:04:50 25 4
gpt4 key购买 nike

我目前正在尝试制作一个弹出表单,但由于某种原因,我的表单只是返回空白。我目前正在关注this website .

当我查看页面源代码时,所有代码仍然存在,但 Blade 中没有显示任何内容。它只是一片空白。应该有弹出按钮显示

这是我的 Blade :

evaltest.blade.php

 <html>
<head>
<title>Popup contact form </title>
<meta name="robots" content="noindex, nofollow">
<link href="{{ asset('css/elements.css') }}" rel="stylesheet">
<script src="js/my_js.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43981329-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<!-- body starts here -->
<body id ="bdy" style="overflow:hidden;">

<div id="abc">

<!-- Popup div starts here -->
<div id="popupContact">

<!-- contact us form -->
<form class="form-horizontal" method="post" action="{{ url('/evaltest/'.$data->id) }}">
{{ csrf_field() }}
<input type="hidden" name="user_id" value="{{$data->id}}">

<div class="form-group">
<label class="col-md-2"><b>Recommendation:</b></label>
<div class="col-md-6">
<input type="radio" id ="recommendation" name="recommendation" value="Yes"> Yes<br>
<input type="radio" id ="recommendation" name="recommendation" value="No"> No<br>
</div>

<div class="form-group">
<label class="col-md-2"><b>Training Schedule:</b></label>
<div class="col-md-6">
<input type="radio" id = "training_schedule" name="training_schedule" value="Yes"> Yes<br>
<input type="radio" id = "training_schedule" name="training_schedule" value="No"> No<br>
<input type="radio" id = "training_schedule" name="training_schedule" value="NIL"> NIL<br>
</div>

<div class="form-group">
<label class="col-md-2"><b>Training Date (key in date if yes or pending, else just say nil and leave the date):</b></label>
<div class="col-md-6">
<input type="date" id = "training_date" name="training_date" class="form-control">
<input type="text" id = "training_date" name="training_date" class="form-control">
</div>
<a id="submit" href="javascript: check_empty()">Send</a>
</form>
</div>
<!-- Popup Div Ends Here -->
</div>
<!-- Display Popup Button -->
<h1>Click Button To Popup Form Using Javascript</h1>
<button id="popup" onclick="div_show()">Popup</button>
</body>
<!-- Body Ends Here -->
</html>

这是我正在使用的 Controller :

     public function getEval1(){
$data = personal_info::whereDoesntHave('evaluations')->first();
if(count($data)>0){
return view('evaltest',compact('data'));
}else{
return view('evaltest');
}

以下是路线:(如果需要)

Route::get('/user/showupdate8/{id}/evaltest', 'evalController@getEval1');
Route::post('/evaltest/{id}', 'evalController@eval');

对于 JavaScript 和 CSS,我只是从网站复制并粘贴,因此不会有任何差异。但对于 JavaScript,我只用我的替换了他们的 id,其余保持不变。

最佳答案

首先纠正你的js包含代码

<script src="{{ asset('/js/my_js.js) }}"></script> 

如果在网页的页脚区域包含js代码就好了。

关于javascript - Laravel 中未显示弹出按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47217053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com