Split url with javascript -


I am trying to split the following url:

To get only

I am using javascript window.location.href and partition, but not yet success. How can this be done? Thanks

try it

  var fullurl = "http: // Www.store.com/products.aspx/Books/The-happy-donkey ", url = fullurl.split (" .aspx ") [0] +" .aspx ";    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -