0

My jQuery script change search result link separately, but I want to change it all together, resp. I want to get this link format:

?page=1&sort=1&order=1

Here is that jQuery script to modificate:

    // Change Sort Type
      $(".sort").change(function() {                
            editResults("?page=1&sort="+$(this).val());
      });
    // Change Order Type
      $(".order").change(function() {               
            editResults("?page=1&order="+$(this).val());
      });

1 Answer 1

4
  // Change Sort Type
      $(".sort").change(function() {                
            editResults("?page=1&sort="+$(this).val()+"&order="+$(".order").val());
      });
    // Change Order Type
      $(".order").change(function() {               
            editResults("?page=1&order="+$(this).val()+"&sort="+$(".sort").val());
      });

in general:

   function changeSortAndOrder(sort, order) {
           editResults("?page=1&order="+order+"&sort="+sort);
   }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.