Team:UNITN-Trento/Templates/Notebook
From 2013.igem.org
(Difference between revisions)
Line 10: | Line 10: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
+ | |||
+ | last_id = 0; | ||
//Get posts from ajax index | //Get posts from ajax index | ||
$("#aj_index a").each(function() { | $("#aj_index a").each(function() { | ||
- | + | href = $(this).attr('href'); | |
+ | id = href.split("/"); | ||
id = id[id.length - 1]; | id = id[id.length - 1]; | ||
alert(id); | alert(id); | ||
+ | |||
+ | //Save highest id (last post) | ||
+ | if( id > last_id ) { | ||
+ | last_id = id; | ||
+ | } | ||
+ | |||
+ | //Add 'add post' button | ||
+ | $("<a>Add new LabPost_AJ</a>").attr( 'href' , href ).addClass("tn-addpost").appendTo("#aj_cont"); | ||
}); | }); | ||
Revision as of 07:04, 19 August 2013
[http://2013.igem.org/wiki/index.php?title=Team:UNITN-Trento/Templates/Notebook&action=edit Edit this page] | Main Page
Retrieved from "http://2013.igem.org/Team:UNITN-Trento/Templates/Notebook"