How to get query string from url with jQuery
URL = http://www.example.com/?name=jems<script type="text/javascript">
$(document).ready(function() {
var sPageURL = window.location.search.substring(1);
var sParameterName = sPageURL.split('=');
$('#strg').html(sParameterName[1]);
$('#strg1').attr('href','http://example.com/step-2/?name='+sParameterName[1]);
});
</script>
No comments:
Post a Comment