FANDOM


CLICK ME

wiki_image_placeholder.png

Warpriest of Zamorak set equipped2

Warpriest of Zamorak set equipped2

var users = []; $('#WikiChatList .User').each(function() { users.push($(this).children().find('.username').text()) });


var test = [];
$('#WikiChatList li .username').each(function() {
  if ($.inArray($(this).text(), test) == -1) {
    test.push($(this).text());
  }
});
alert(test);

Some Notes

rail: --> width: 160px !important;

chat: --> left: left: 176px !important;

logs: --> remove "

var music  = '<div style="width: 152px; overflow: hidden; height: 18px; position: relative; border: 3px outset #0f0f0f; margin-bottom: 5px;"><iframe width="417" height="27" src="https://www.youtube.com/embed/' + $('#music').val() + '?version=3&hl=en_US&theme=dark&color=white&loop=1&showinfo=0&autohide=0&disablekb=1&autoplay=0" frameborder="0" allowfullscreen=0></iframe></div>';
$('#musiclist').append(music);

Adding this when JS is editable

$('#WikiaRail').append($('<section class="module">\
    <h2>Stuff</h2>\
    <ul>\
        <li><a href="/wiki/JavaScript_Snippets">JavaScipt Snippets</a></li>\
    </ul>\
</section>'));

Bad Idea

if (wgPageName == "I'd_advise_against_you_going_to_this_page.") {
    alert('Wow you came anyways, so...');
    alert('Guess what?');
    alert('DEEZ NUTZ');
    alert('HAH GOTEM');
}

Stuff

$('.Chat ul li').each( function() {
    if ($(this).attr('data-user') == "ChaoticShadow") {
        $(this).each( function() {
            $(this).children().find('.message').html("1"); 
        });
    }
});

gives error


$.get(url, function(data) { var newDocument = $(data); $(newDocument).find('whatever'); });

var x = $('input').val(); $.get('https://www.youtube.com/watch?v=' + x, function(page) { var newp = $(page); $(newp).find($('this'));

$.get('https://www.youtube.com/watch?v=q5mdZxtko0A', function(page) { var newp = $(page); $(newp).find($('.watch-title ')); });


$('textarea').val(Math.random().toString(36).substring(7));

//ty to oz var clonedElement = $('#foo').clone(true,true); clonedElement.attr('id','bar'); $('#foo').remove(); //remove old element

Community content is available under CC-BY-SA unless otherwise noted.