prez_js/assets/clientApp.js
2016-01-22 00:00:27 +01:00

33 lines
877 B
JavaScript

//var bla = function
$(document).ready(function(){
var row = function(data){
var htmlobj = "<div>"+data.title+" |"+ data.url+
//" </div>"+ "<div class='presLink'><button value='"+ data.url+"'> launch </button></div>"
"<button class='presLink' value='"+data.url+"' > launch </button></div>"
//return "<div><div>"+data.title+"</div> <div>| "+ data.url+" </div>"+ "<button class='.presLink'value='bla'> launch </button></div>"
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("<div> <p>"+data.title +"</p></div>")
$("#ressources_list").append(row(data))
$(".presLink").click(function(){
console.log(this.value)
})
}
})
})
})