0

directory.html と customer.html の 2 つの HTML ページがあります。

directory.html ページからアクション ページ (customer.html) に表示されるテキスト フィールドに値を設定しようとしています。

jQuery の load 関数を使用してディレクトリ ページをロードしています。load 関数を使用してアクション ページをロードするとすぐに、テキスト フィールドの値を (自動的に) 設定する方法を教えてください。

ティア

4

1 に答える 1

1

load関数でload-finishedコールバックを使用します。

   //Store customer.html form field values here.
   var field1 = $('#field1').val();
   $("#directory").load("directory.html", {var:'value'}, function(){
       //load the info from the first page here
       $('#field1').val(field1);
    });
于 2012-04-22T19:26:47.520 に答える