私のcore.jsファイルにajaxハッシュURLが関係していると確信しています。しかし、フォームを送信しようとしていますが、希望どおりに送信されません。これは core.js ファイルです。
// call init
$(init);
function init() {
ajax_page_handler();
page_load($(window.location).attr("hash")); // goto first page if #! is available
}
function page_load($href) {
if($href != undefined && $href.substring(0, 2) == '#/') {
// replace body the #content with loaded html
$('#content').load($href.substring(2), function () {
$('#content').hide().fadeIn('slow');
});
}
}
function ajax_page_handler() {
$(window).bind('hashchange', function () {
$href = $(window.location).attr("hash");
page_load($href);
});
// this allow you to reload by clicking the same link
$('a[href^="#/"]').live('click', function() {
$curhref = $(window.location).attr("hash");
$href = $(this).attr('href');
if($curhref == $href) {
page_load($href);
}
});
}
www.krissales.com でのライブ ビューイングは終了しました。フォームはこちら: http://www.krissales.com/#/media/5.Testing-1
リンク「コメントを投稿」をクリックしてから、情報を入力してからコメントを押しますが、更新されるだけで送信されません。
それを解決するために私が取った手順は、コメントファイルのフォームアクションフィールドにあり、name="#content"
送信先のdivの名前であるため、タグを挿入しました。
元のものはhttp://blog.krissales.com/article/7.Testing-3-manにあります (実際にコメントを投稿すると機能します)
しかし、どうやらそれは機能していません。私が間違っているのは何かについての手がかりがありますか?事前に助けてくれてありがとう!
<script type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "simple"
});
</script>
<form action="#/media/article.php" name="#content" method="POST">
Name:
<br />
<input type="text" name="name" class="userpass"/>
<br /><br />
Comment:
<br />
<textarea id="elm1" name="comment" rows="7" cols="30" style="width: 500px;">
</textarea>
<br />
<input type="submit" name="submit" value="Comment" class="button" />
<input type="reset" name="submit" value="Reset" class="button" />
</form>