yQvVWBIp's avatar

Get URL

Hello,

I have done pagination using laravel.

Now I have a URL : http://laravel.dev/home?page=2 page number can be varied.

I can have URL using javascript function : window.location.href How do I get that string ?

How can I get : page=2, page=3 using JAVASCript ?

Thanks!

0 likes
3 replies
bobbybouwmann's avatar
Level 88
<script>
    var page = window.location.href.split('?')[1];
</script>
1 like
shankarwram's avatar

How would i call a function URL() from js file. is this supports built in functions for javascript

Please or to participate in this conversation.