0

The following function triggers a search function and loads their results into a container. For some unknown reason, unlike if one types the URL and query into the browser bar, it only seams to work if their are 5 or more characters in the search.????

function searchelectors(q){
    t=$(q).val().replace(" ","+");
    $('.searchelectors').load('<?php echo 'http://'.$site_url.$site_uri;?>?q=' + t + ' .searchelectors',function(){
        $('.searchelectors .wheel').slideUp(200);   
    });
}

1 Answer 1

1

Encode your querystring value and send it. You can use encodeURIComponent method.

function searchelectors(q){
    t=$(q).val().replace(" ","+");
    t = encodeURIComponent(t);
    $('.searchelectors').load('<?php echo 'http://'.$site_url.$site_uri;?>?q=' + t + ' .searchelectors',function(){
        $('.searchelectors .wheel').slideUp(200);   
    });
}
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.