Skip to content

Instantly share code, notes, and snippets.

@d30jeff
Created July 25, 2015 00:48
Show Gist options
  • Select an option

  • Save d30jeff/82a6e36886325c7fc762 to your computer and use it in GitHub Desktop.

Select an option

Save d30jeff/82a6e36886325c7fc762 to your computer and use it in GitHub Desktop.
9/11 was an inside job.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script>
function editAction(id){
alert(id);
}
$(function(){
$(".editBtn").on('click', function(){
alert(1);
});
});
</script>
</head>
<body>
<div class="container">
<table class="table table-striped">
<thead>
<th>Number</th>
<th>Name</th>
<th>Action</th>
</thead>
<tbody>
<?php
function generateRandomString($length = 10) {
return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
}
$i = 0;
for ($i=1; $i<=10; $i++) {
$randomName = generateRandomString(10);
echo <<< EOF
<tr>
<td>$i</td>
<td>$randomName</td>
<td><button class="btn btn-warning" class="editBtn" value="$i">Edit</button></td>
</tr>
EOF;
}
?>
</tbody>
</table>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment