very basic code which we use offten in our day to day development and sometime we stucked . i write those issue here with simple solution. You will get codes of html, css, javascript, jquery, json,ajax, node.js, vue.js, nuxt.js, php and Mysql
Wednesday, March 27, 2013
get and split url using javascript
<script>
function getPathFromUrl() {
var url = window.location.href;
if(url.indexOf("html") != -1)
url = url.split(".")[0];
window.location.href;
//return url;
}
$("#a").click(function(){
alert(getPathFromUrl());//this will alert the url without querystring
});
</script>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment