jeudi 23 novembre 2017

adding more than one checkboxes value to url like Myntra filters

This is my URL http://ift.tt/2mS59ic

I want to append checkboxes values to URL without page reload , problem that I am facing that I am unable to append URL in desired way Like I want my URL to be like this http://ift.tt/2zujx6q

Here brand is first checkbox and product platform is second and want them to be appended with selected checkboxes so on

I have tried many of codes but none get me desired result.

This code is appending ids to same string but i want them to be like http://ift.tt/2zujx6q

   Latest code which I am trying is

$checkboxes = jQuery('input[type=checkbox');
            $checkboxes.change(function(){
                var id = $checkboxes.filter(':checked').map(function(){
                    return this.id;   
                }).get().join(",");
                window.location.hash = id ? 'check=' + id : '';

            });

Any help will be appreciated




Aucun commentaire:

Enregistrer un commentaire