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
Post a Comment