我有這樣的jQuery的功能:
$('#invite_friends_email').live('click' , function()
{
$("#invite_friends_email").dialog();
return false;
});
,並在該網頁上我導入喜歡這個div:
<?php
include '../divs/invite_frineds_by_email.php';
?>
,並在div本身看起來是這樣的:
<div id="invite_friends_email" style="display: none;">
<form method="post" action="">
<p>
<br />
<h3>Enter Your Friends Email Addresses (Separated by Comma)</h3>
<textarea type="textarea" rows="2" cols="75" name="emails"></textarea>
</p>
<p>
<strong><h3>Email Subject (Edit subject to add your name so your friends recognize you)</h3></strong>
<input type="text" name="subject" size="75" value="Your friend wants to invite you to brainstorm problem solutions">
</p>
<p>
<h3>Enter Your Message: (Edit the body of the text however you like)</h3>
<textarea type="textarea" rows="5" cols="75" name="message">Here is the URL of the problem:
http://www.problemio.com/problems/problem.php?problem_id=<?php echo $problem_id; ?>
</textarea>
</p>
<p>
<input type="submit" style="border: none;" alt="Send email!" />
</p>
</form>
</div>
你可以點擊「通過電子郵件邀請朋友」鏈接,再次出現當前問題: http://www.problemio.com/problems/problem.php?problem_id=225。現在我可以知道點擊函數正在被調用,但不知道爲什麼對話框沒有彈出。任何想法如何讓它出現?