Ver código fonte

Listing 6.9bis: using has() advanced selector.

Frederic G. MARAND 9 anos atrás
pai
commit
6b70ba9e23
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      Chapter 6/06.js

+ 1 - 1
Chapter 6/06.js

@@ -42,7 +42,7 @@ $(document).ready(function () {
     event.preventDefault();
     $.get('d.xml', function (data) {
       $('#dictionary').empty();
-      $(data).find('entry').each (function () {
+      $(data).find('entry:has(quote[author])').each (function () {
         var $entry = $(this);
         var html = '<div class="entry">';
         html += '<h3 class="term">' + $entry.attr('term');