diff --git a/js/javascript.js b/js/javascript.js index 3fcd2e8..9e35cb6 100644 --- a/js/javascript.js +++ b/js/javascript.js @@ -1,24 +1,32 @@ function load_slides() { var filelist = [ "What is the world made of", - "Strong interactions" /*, - "The Electromagnetic Interaction", - "Nuclear decay and the weak interaction", - "The Three Generations of Matter", - "The Higgs", - "Antimatter"*/ - ]; + "Strong interactions" /*, + "The Electromagnetic Interaction", + "Nuclear decay and the weak interaction", + "The Three Generations of Matter", + "The Higgs", + "Antimatter"*/ + ]; //$(filelist).each(function(){alert($(this).html());}); + var last = false; + for (var i = 0; i < filelist.length; i++ ) { + + if (i == filelist.length - 1 ) { + last = true; + } + var filename = to_filename(filelist[i]); // get - var chapter = get_html(filename, "chapter", "html"); + var chapter = get_html(filename, "chapter", "html", last); //var readmore = get_html(filelist[i], "readmore", "html"); // here we just need the URL //var icon = get_html(filelist[i], "img", "png"); // - //alert ($.html(chapter)); + //alert (chapter); + } @@ -29,10 +37,16 @@ function to_filename(title) { return title.toLowerCase().replace(/ /g, '_'); } -function get_html(file, prefix, extension ){ +function get_html(file, prefix, extension, last ){ - $.ajax( "./" + prefix + "/" + file + "." + extension ).done( function(data) { - alert(data); - }); + $.ajax( "./" + prefix + "/" + file + "." + extension ).done( function(data) { + //alert('