//var bla = function $(document).ready(function(){ var row = function(data){ var htmlobj = "
"+data.title+" |"+ data.url+ //"
"+ "" "" //return "
"+data.title+"
| "+ data.url+"
"+ "
" return htmlobj } $("#addUrl").click(function(){ console.log("Hey") var url=$("#urlText").val() $.post("/", {url:url}, function(data){ console.log(data) if (data.url){ //$("#ressources_list").append("

"+data.title +"

") $("#ressources_list").append(row(data)) $(".presLink").click(function(){ console.log(this.value) }) } }) }) })