Changeset 3329


Ignore:
Timestamp:
08/08/13 12:34:21 (11 years ago)
Author:
sroth
Message:

Realized retrieval of list of aids from mock GET api/annotations?link="URI".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/test/mockjax/mockjax-xml.js

    r3324 r3329  
    3131                // success: function(xml) {   
    3232                // can be used if parameters textStatus and jqXHR are not required within the following code block
    33                     console.log('Data: ' + $(xml));
    34                     console.log($(xml));
     33                   
     34                    $xml = $(xml);
     35                   
     36                    console.log('Data: ' + $xml);
     37                    console.log($xml);
    3538                    console.log('Status: ' + textStatus);
    3639                    console.log('XMLHttpRequest object: ' + jqXHR);
    3740                    console.log(jqXHR);
    38 
    39                     var headline = "";
    40                     $(xml).find('annotation').each(function() {
    41                         headline += '<br />' + $(this).find('headline').text();
     41                   
     42                    var aidArr = [];
     43                    var aid_string = "";
     44                    $xml.find('annotations annotation').each(function() {
     45                        aidArr.push($(this).attr('ref').substr(29)); // http://dasish.eu/annotations/ is erased
    4246                    });
    43                     $('#xmlContents').html('<h4 style="margin-bottom: 0;">Headline:</h4>' + headline);
     47 
     48                    console.log(aidArr);
     49                   
     50                    for(var i in aidArr) {
     51                        aid_string += '<br />' + aidArr[i];
     52                        $('#xmlContents').html('<h4 style="margin-bottom: 0;">List of AIDs returned from REST service address<br />GET api/annotations?link="URI":</h4>' + aid_string);
     53                    }
     54                   
    4455                }
    4556            });
Note: See TracChangeset for help on using the changeset viewer.