javascript - To get path name with url values in jquery -


this example url.

 http://stackoverflow.com/questions/ask?a=1&b=2 

question: need fetch path name along url values this

/questions/ask?a=1&b=2
need jquery or javascript solution

var url = document.createelement('a'); url.href = 'http://stackoverflow.com/questions/ask?a=1&b=2'; alert(url.pathname + url.search); 

demo: http://jsfiddle.net/karim79/8xyyj/


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -