Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <script type="text/javascript">
  2. function getType( obj )
  3. {
  4. return Object.prototype.toString.call(obj);
  5. }
  6. $(function() {
  7. $(".player-search-field").autocomplete({
  8. serviceUrl: "https://brave.rip/leaderboards/core.php",
  9. paramName: "value",
  10. params: {
  11. "query": "name"
  12. },
  13. formatResult: function (suggestion, currentValue) {
  14. return "<img src=\"https://minotar.net/avatar/" + suggestion.value + "/20.png\">\n" + $.Autocomplete.defaults.formatResult(suggestion, currentValue);
  15. },
  16. onSelect: function (suggestion) {
  17. $("#search-form").submit();
  18. }
  19. });
  20. function replaceAll(str, find, replace) {
  21. return str.replace(new RegExp(find, "g"), replace);
  22. }
  23. });
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement