我有这个javascript函数,当用户点击一个按钮触发打开模态时调用它:
echo "
<text style = 'font-size: 20px'><center><b>Qualifications</b></center></text>
<label class = 'jdetails'>Age:</label>
<text class = 'jdetails'>$min</text>
<text class = 'jdetails'>-</text>
<text class = 'jdetails'>$max</text>
<text class = 'jdetails'>years old</text><br>
<label class = 'jdetails'>Gender:</label>
<text class = 'jdetails'>$gen</text><br>
<label class = 'jdetails'>Height:</label>
<text class = 'jdetails'>$ht</text>
<text class = 'jdetails'>cm</text><br>
<label class = 'jdetails'>Education:</label>
<text class = 'jdetails'>$educ</text><br>
<label class = 'jdetails'>Course:</label>
<text class = 'jdetails'>$cour</text><br><br>
<div class = 'col-lg-4' style = 'float: left'>
<text class = 'jdetails'><center><b>Skills</b></center></text>
<ul>
<li class = 'jdetails'>dfasdf</li>
</ul>
</div>
<div class = 'col-lg-4' style = 'float: left'>
<text class = 'jdetails'><center><b>Requirements</b></center></text>
<ul>
<li class = 'jdetails'>dfasdf</li>
</ul>
</div>
<div class = 'col-lg-4' style = 'float: left'>
<text class = 'jdetails'><center><b>Additional Qualifications</b></center></text>
<ul>
<li class = 'jdetails'>dfasdf</li>
</ul>
</div>";
我的passJobID.php
中有类似的内容undefined index 'vals'
我想将这个回显的html代码块打印到我的模态中。我尝试在我的模态中包含passJobID.php,但我收到错误 <button class='btn btn-default1 btn-sm jedit' data-toggle = 'modal' data-target = '#view' onclick = 'view($id, \"$name\")'>View Details</button>
这是代码打开模态的方式
<div id = "view" class = "modal fade" role = "dialog" onload = "view(document.getElementById('jid').value, document.getElementById('jtitle').value)">
<div class = "modal-dialogjob">
<div class = "modal-contentjob">
<div class = "modal-header">
<button type="button" class="close" data-dismiss="modal">exit ×</button>
<h3 class="modal-title" id = "jtitle"><center></center></h3>
</div>
<div class = "modal-body">
<form style = "padding: 5px;">
<input type = "hidden" id = "jid">
<!--<?php
include('passJobID.php');
?>-->
</form>
</div>
</div>
</div>
</div>
这是我的模态代码:
JSONObject outerObject = new JSONObject();
JSONArray outerArray = new JSONArray();
JSONObject innerObject = new JSONObject();
JSONArray innerArray = new JSONArray();
innerObject = new JSONObject();
innerObject.put("label", "1");
innerObject.put("value", "one");
innerObject.put("color", "008ee4");
innerArray.add(innerObject);
outerObject.put("data", innerArray);
System.out.println(outerObject.toString());