parsing - how to parse with jquery the id from a uri like http://beta.domo.md/ro/smartphones/159-philips-s388-android.html (id=159)? -


how parse jquery id url

"http://beta.domo.md/ro/smartphones/159-philips-s388-android.html" (id=159)

or

"/ro/smartphones/159-philips-s388-android.html" ?

i think help, try it:

var url="http://beta.domo.md/ro/smartphones/159-philips-s388-android.html"; var url1=url.substring(url.lastindexof("/")+1); var id=url1.substring(0, url1.indexof("-")); 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -