Explorar o código

Listing 6.9bis: using has() advanced selector.

Frederic G. MARAND %!s(int64=9) %!d(string=hai) anos
pai
achega
6b70ba9e23
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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');