$.urlParam = function (name) {
var results = new RegExp('[\\?&]' + name + '=([^]*)').exec(window.location.href);
if (results != null)
return results[1] || 0;
else
return results;
//return results != null ? results[1] || 0 : results;
}
2do Luego en tu pagina:
<script type="text/javascript">
$(document).ready(function () {
if ($.urlParam('id') != null){
alert('Paremetro: ' + $.urlParam('id'))
}
});
</script>
No hay comentarios:
Publicar un comentario