javascript - How to get only numbers from URL? -


i have got javascript on blank page:

please show number supplier: <script> document.write(document.url); </script> 

so shows

"please show number supplier: http://www.exaple.com/invoices/123456789" 

how extract numbers url this?

"please show number supplier: 123456789" 

if (location.search != "") { var x = location.search.substr(1).replace(/%2520/g,' ').split(";") (var i=0; i<x.length; i++) {     var y = x[i].split("=");     document.write(y[0]) } }    

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -