我有主页index.php,在此页面上按钮点击我使用ajax加载url.php。
在url.php中我有text box。我希望当用户在此texbox中使用courser输入内容时,其下方的按钮显示为可见。
url.php
Get Sentiment
的index.php
在身体部位:
$("#text").keypress( function() {
document.getElementById("b1").style.display = "block";
console.log( "Handler for .keypress() called." );
});
但是当我转到文本框并单击其中时,文本框不会出现。我也尝试过
blur和focus代替keypress,但没有变更。
要使用ajax加载url.php我有以下代码:
$("#load_url").click(function(){
$.ajax({
url:"url.php",
success:function(response) {
$("#view_port").html(response);
$("#load_url").hide();
}
});
});