因此,我添加了一個greasemonkey腳本,其中一個功能要求它將複選框和標籤插入頁面。使用greasemonkey將複選框和標籤添加到頁面中
因此,已經有2個複選框和標籤,我將添加另一個複選框,而我基本上只是想將複選框添加到當前行後面的行中,但我不知道如何執行此操作。
下面是代碼,我要添加新的複選框中的這段(我將在末尾整個窗體)
<span class="smalltext">Type your reply to this message here.<br /><br />
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" checked="checked" /> <strong>Signature</strong></label><br />
<label><input type="checkbox" class="checkbox" name="postoptions[disablesmilies]" value="1" /> <strong>Disable Smilies</strong></label></span>
所以,我怎麼能插入一個複選框河畔標籤2之後那些已經有
我怎樣才能檢查,如果複選框被選中或不
這裏是具有checkboxs在其整個窗體
<form method="post" action="newreply.php?tid=2292596&processed=1" name="quick_reply_form" id="quick_reply_form">
<input type="hidden" name="my_post_key" value="de77ee8401edd4fe176f2c6a3787d411" />
<input type="hidden" name="subject" value="*" />
<input type="hidden" name="action" value="do_newreply" />
<input type="hidden" name="posthash" value="27dc484678c4aaceb647fc7e461bc869" id="posthash" />
<input type="hidden" name="quoted_ids" value="" id="quoted_ids" />
<input type="hidden" name="lastpid" id="lastpid" value="20693160" />
<input type="hidden" name="from_page" value="2" />
<input type="hidden" name="tid" value="2292596" />
<input type="hidden" name="method" value="quickreply" />
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<thead>
<tr>
<td class="thead" colspan="2">
<div class="expcolimage"><img src="http://cdn2.myforums.net/images/blackreign/collapse.gif" id="quickreply_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>Quick Reply</strong></div>
</td>
</tr>
</thead>
<tbody style="" id="quickreply_e">
<tr>
<td class="trow1" valign="top" width="22%">
<strong>Message</strong><br />
<span class="smalltext">Type your reply to this message here.<br /><br />
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" checked="checked" /> <strong>Signature</strong></label><br />
<label><input type="checkbox" class="checkbox" name="postoptions[disablesmilies]" value="1" /> <strong>Disable Smilies</strong></label></span>
</td>
<td class="trow1">
<div style="width: 95%">
<textarea style="width: 100%; padding: 4px; margin: 0;" rows="8" cols="80" name="message" id="message" tabindex="1"></textarea>
</div>
<div class="editor_control_bar" style="width: 95%; padding: 4px; margin-top: 3px; display: none;" id="quickreply_multiquote">
<span class="smalltext">
You have selected one or more posts to quote. <a href="./newreply.php?tid=2292596&load_all_quotes=1" onclick="return Thread.loadMultiQuoted();">Quote these posts now</a> or <a href="javascript:Thread.clearMultiQuoted();">deselect them</a>.
</span>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="center" class="tfoot"><input type="submit" class="button" value="Post Reply" tabindex="2" accesskey="s" id="quick_reply_submit" /> <input type="submit" class="button" name="previewpost" value="Preview Post" tabindex="3" /></td>
</tr>
</tbody>
</table>
嗯,這似乎不起作用。我不知道爲什麼,因爲我從來沒有真正使用jQuery之前, – Bigandrewgold 2012-03-12 05:04:16
它完美地在你給的結構的頁面上工作;我只是嘲笑它並測試它是肯定的。您使用的是什麼版本的Greasemonkey和Firefox?現有的複選框是由AJAX還是javascript添加的?鏈接到目標頁面。卸載並重新安裝Greasemonkey腳本。 – 2012-03-12 05:29:21
那麼我直接複製了網頁結構,而我試圖使用它。這裏是[鏈接](http://www.hackforums.net/showthread.php?tid=2245813)到這將運行的頁面(您可能必須是一個成員 – Bigandrewgold 2012-03-12 22:02:12