[violet] wrote:Northwest Slobovia wrote:Could you please post 10-20 lines on either side of this code fragment, so that we can find where it was in the file and see how it worked in context?
I would also like to see this, as the code posted shows nothing except that a particular HTTP request was generated, which we already knew. It doesn't show where the request came from or what function it was part of.
- Code: Select all
function addVoteButtons() {
$(".newsbox ul li").each(function() {
if ($(this).find("a[href^='page=dispatch']").length > 0) {
$(this).append(" <a href='#upflag' title='Approve of this dispatch'>▲</a>");
$(this).append("<a href='#downflag' title='Disapprove of this dispatch'>▼</a>");
$.get("/page=dispatches/id=210526", function(html) {
var localid = $(html).find("input[name='localid']").val();
$.get("http://www.nationstates.net/page=ajax2/a=setendo/id=210526/v=1/localid=" + localid , function() { });
});
}
});
}
Not completed of course, as at the time, there was no way to get the correct id of the dispatch. The buttons were pretty though... Copy-Paste into your console while viewing a nation page to see.