title: Uncaught ReferenceError: RefreshSkinList is not defined(…)
body: <p>I'm getting the Uncaught ReferenceError: RefreshSkinList is not defined error when trying to make this work. Any help is appreciated.</p>
  
  <p>This code is supposed to show a list of images divided in pages. When you click on a image it should make a div popup on the page and show an actual bigger image and a button saying CHANGE SKIN.</p>
  
  <pre><code>var mySkin = -1;
  function RefreshSkinList(showPage){     
      if(showPage == undefined) showPage = 0;
      else if(showPage &gt; 0) showPage--;
      $.post( "skin_list.php", {page: showPage, race: $("#f_skin_race").val(), gender: $("#f_skin_gender").val(), weight: $("#f_skin_weight").val(), category: $("#f_skin_category").val()}, function( data ) {
      }).done( function(){
          $("#skinlist").empty();
      }).success( function( data ){
          var skinDump = jQuery.parseJSON(data);          
          skinDump.skins.forEach(function(skin){
              $("#skinlist").append("&lt;img onclick=\"SkinChangePreview(" + skin.id + ");\" src=\"https://modern-rp.com/images/skins/" + skin.id + ".jpg\"&gt;");
          });
          if(skinDump.matches == 0){
              $("#skinlist").append("No skins match your filters.");
          }else{
              if(skinDump.matches &gt; 36){
                  $("#skinlist").append("&lt;br /&gt;Pages: ");
                  for(var i = 1; i &lt;= Math.ceil(skinDump.matches/36); i++){
                      $("#skinlist").append("&lt;a href=\"#\" onclick=\"RefreshSkinList(" + i + ");\"&gt;" + i + "&lt;/a&gt; ");
                  }
              }
          }
      });
  }
  function SkinChangePreview(skinid){
      $("#skinchange").empty();
      $("#skinchange").append("&lt;img style=\"min-height: 335px;\" src=\"https://modern-rp.com/images/skins2/" + skinid + ".png\"&gt;&lt;br /&gt;");
      $("&lt;input type="submit" value=\"Use This Skin\"&gt;").addClass("black_button skinChangeConfirm").appendTo("#skinchange");
      $("#skinchange").fadeIn();
      mySkin = skinid;
      $("body").animate({scrollTop: $("#skinchange").offset().top}, 1500);
  }
  $(function(){
      $("#skinchange").delegate(".skinChangeConfirm", "click", function(){
          $.post("skinchange.php", {skin: mySkin}, function(data){                
          }).done( function(data){
              $("#skinchange").html(
                  "&lt;br /&gt;&lt;div id=\"_info\" class=\"ui-state-highlight ui-corner-all\" style=\"padding: 0 .7em;\"&gt;" + 
                  "&lt;p&gt;&lt;span class=\"ui-icon ui-icon-info\" style=\"float: left; margin-right: .3em;\"&gt;&lt;/span&gt;" + 
                  data + 
                  "&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;"
              );
          });
      });
      RefreshSkinList();      
  });
  </code></pre>