1234567891011121314151617181920212223242526272829303132333435363738 |
- function notes() {
- var $link = $('#presentation a');
- $link.each(function(){
- $(this).click(function(e) {
- if ($(this).is('#ressource')) {
- e.preventDefault();
- var $url = $(this).attr("href");
- if ($( ".side_notes" )[0]) {
- $( ".side_notes" ).remove();
- }
- $("<div class='side_notes'/>").insertAfter("article");
- ajax($url);
- }else{
- // nothing
- }
- });
- })
- function ajax($url) {
- $.ajax({
- url: $url,
- method: "GET",
- dataType:'html',
- async: true,
- success: function(data) {
- $(data).find('article > div:not(.__wrap_side) .__wrapper').appendTo('.side_notes');
- },
- })
- }
- }
- $( document ).ready(function() {
- notes();
- });
|