views:

189

answers:

2

I have used the jquery quicksearch plugin and it works fine, except for one problem. I would like the quicksearch to run when the page is loaded. I have created a second quicksearch function (which is called when the page is loaded) and changed the bind to something else, but it won't work on "load" or "ready".

If I change the bind to "focus" and put the focus onto the textfield it works, but only in IE.

The reason I want to do this is because there is a "view" link where the user leaves the page. When they come back, I would like the search results to be as they left them.

+1  A: 

lazy solution for you:

$(function(){
//$('search_input').attr('value', search_term); // optional - put something in the search box
$('search_input').keyup(); //trigger the search onload})
Haroldo
A: 

actually thinking about it, it's probably because doc.ready isnt when all js is loaded, so the quick search plugin isnt finished initialising when u call it on page load.

instead you should use a callback on the plugin initialisation

Haroldo