title: $(this).html not working in jquery
body: <pre><code>&lt;globemedia id="1"&gt;&lt;/globemedia&gt;
  
  &lt;script type="text/javascript"&gt;
          $("globemedia").each(function(index, value) {
              var globeIDxMedia = $(this).attr("id");
              $.get("getmedia.jsp?mediaID="+globeIDxMedia,function(a){
                  $(this).html(a);
              });
          });
  &lt;/script&gt;
  </code></pre>
  
  <p>The above Script i use to load content to my customized tag say <code>&lt;getmedia id="1"&gt;&lt;/getmedia&gt;</code> </p>
  
  <p>script works fine till getting data from the page getmedia.jsp but when i use <code>$(this).html(a);</code> its not loading the data.</p>
  
  <p><strong>Got Answer from jquery forum</strong>
  It'll work with custom tag as well</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function(){
              $("div[data-globalmedia]").each(function(index, value) {
                  var globeIDxMedia = $(this).attr("id");
                  $(this).load("getmedia.jsp?mediaID="+globeIDxMedia);
              });
          });
  &lt;/script&gt;
  </code></pre>
  
  <p>jQuery expert gave me solution you have to use <code>$(document).ready(function(){});</code> and it works like a charm</p>