1

テンプレートを使用してWebサイトを開発しました。そこでは、タグをクリックするとダイアログボックスが適切に表示されます。しかし、別のページにあるダイアログ ボックスの div を呼び出す必要があります。PHPでGET ['id']を使用するには、URLから渡されるIDを取得する必要があるためです。この方法でdivを呼び出してみました

 <a href="x.html#myModal2">Alert</a>

しかし、うまくいきません。私の目的を達成するための提案やガイダンスを教えてくれる人はいますか?

これが私の呼び出しタグとダイアログボックスのdivです

    <a href="#myModal2" role="button" class="btn btn-danger" data-toggle="modal">Alert</a>
    <div id="myModal2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true">
    <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
    <h3 id="myModalLabel2">Alert Header</h3>
    </div>
    <div class="modal-body">
    <p>Body goes here...</p>
    </div>
    <div class="modal-footer">
    <button data-dismiss="modal" class="btn green">OK</button>
    </div>
    </div>

これは、x.html ページで呼び出す必要がある同じ div です。

<div id="myModal1" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h3 id="myModalLabel1">Modal Header</h3>
</div>
<div class="modal-body">
<p>Body goes here...</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn yellow">Save</button>
</div>
</div>
4

1 に答える 1

0

私見はできません。

いくつかのクエリ パラメータを渡しdocument.ready()、そのページで実行します

于 2013-06-11T06:42:03.343 に答える