If I try to pass a parameter to a function in the onclick
event it doesn't work, clase
is to access to clase/index method from a codeigniter controller.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap -->
<link href="<?php echo base_url('bootstrap/css/bootstrap.min.css');?>" rel="stylesheet">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="<?php echo base_url('bootstrap/js/bootstrap.min.js');?>"></script>
<script language='javascript' type='text/javascript' src="<?php echo base_url('js/action.js');?>"></script>
</head>
<body>
<div class='container'>
<h1>Esta página es solo accesible para el administrador.</h1>
<a class="btn btn-success" onclick ="go('clase')">Volver</a>'
</div>
</body>
</html>
And this is the function
function go(url){
//var url = "clase";
$(location).attr('href',url);
}
Without the parameter it works. But if I pass the parameter, nothing happens.