0 レビュー
2 回答
jquery.getphpから別の入力への結果
次のコードを使用しています:
$('#inputname').change(function(){ //on change event
var parentVal = $('#inputname').val();
$.ajax({
url : 'file.php',
type : 'GET', //type of request, GET or POST
data: ({ svalue: parentVal }),
success : function(data){ $('#slug').html(data); }
});
});
phpで処理した後、あるテキストフィールドに入力されている内容を別のテキストフィールドに表示したい。ファイルphpには、テスト目的のエコー$_GET['svalue']しかありません。
何か考えはありますか?ありがとうございます!
わからない
0
レビュー
答え :
解決策:
私はあなたを助けるかもしれない何かを共有することがあります。 使用場所:
use .html() to operate on containers having html elements.
use .text() to modify text of elements usually having separate open and closing
tags
使用しない場所:
.text() method cannot be used on form inputs or scripts.
.val() for input or textarea elements.
.html() for value of a script element.
Picking up html content from .text() will convert the html tags into html
entities.
違い:
.text() can be used in both XML and HTML documents.
.html() is only for html documents.
わからない
同様の質問
私たちのウェブサイトで同様の質問で答えを見つけてください。