Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "news": [
- {
- "URL": "",
- "newsid": "2104",
- "thefile": "HB2.jpg",
- "title": "mytitle",
- "important": "0",
- "details": "nothinghere",
- "category": "pop",
- "lastname": "Johnson",
- "firstname": "John",
- "thedate": "2014-10-16"
- }
- ]
- }
- $.each(data.news, function(i,newsitem){
- text+='<tr class="danger" data-info="'+data.news[i]+'">';
- text+='<td class="col-sm-1">'+newsitem.firstname+newsitem.lastname+'</td>';
- text+='<td class="col-sm-3">'+newsitem.title+'</td>';
- text+='<td class="col-sm-1">'+newsitem.category+'</td>';
- text+='<td class="col-sm-4">'+newsitem.details+'</td>';
- text+='<td class="col-sm-2">'+newsitem.thedate+'</td>';
- text+='</tr>';
- });
- $("#latestspace").on('click','tr',( function(event){
- alert($(this).attr('data-info').URL);
- }))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement