我在 HTML 中有一个表单和两个模式,在 PHP 中我做了一个函数来检查域是否存在,最后,在 AJAX 中,我有一个小函数.done,但问题就在那里。我希望,如果 PHP 返回 1,则 javascript 向用户显示“AvailableModal”模态,如果它返回 0,则显示“UnavailableModal”。但是 PHP 只返回 1 或 0 而 javascript 什么都不做。
HTML:
<form action="" method="POST">
<input type="text" class="p-3 form-control form-control-lg mb-2 mr-sm-2 input-ro www" id="inlineFormInputName2" name="www." value="www." placeholder="www." readonly>
<div class="input-group justify-content-center mb-2 mr-sm-2">
<input type="text" name="domain" id="domain" class="input-dom form-control form-control-lg">
</div>
<div class="form-check mb-2 mr-sm-2 select-padding">
<select name="point" id="point">
<option value=".com">.com</option>
<option value=".com.br">.com.br</option>
<option value=".net">.net</option>
</select>
<button type="submit" id="salvar-form" class="btn btn-dominio btn-outline-danger" name="send" value="Send">
</button>
<div class="modal fade hide" id="availableModal" tabindex="-1" role="dialog" aria-labelledby="TituloModalCentralizado" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
Domain Available!
</div>
</div>
</div>
</div>
<div class="modal fade hide" id="unavailableModal" tabindex="-1" role="dialog" aria-labelledby="TituloModalCentralizado" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
Domain unavailable!
</div>
</div>
</div>
</div>
</form>
Qyouu