Good day!

The Situation:

I work for a company that includes the Google CSE (free version).
Implementing the search engine, editing the CSS, adding sorting
filters has been a breeze. Refinements were added through the control
panel and works fine if the user selects them.

The Problem:

On the result page are 3 refinements tab (General, News, Reviews). I
want to be able to enter the desired refinement directly into the URL
with the search/sort/refinement criteria.

i.e:  www.mywebsite.com?q=criteria&sort=date#Reviews

A way that i've found to do so is to append a #<here be refinement> to
my URL. I can bind a click listener on each tab by executing the
following code in the $(document).

  jQuery(".gsc-tabsArea div").live("click" , function()
  {
    // Add the proper hashtag to the URL
    jQuery.bbq.pushState("#" + jQuery("div.gsc-tabhActive").text());
    return false;
  });

I've looked through the API documentation and found the
SearchCompleteCallback function that i can hook up the following code:

  var refinement = jQuery.param.fragment();
  var tabs = jQuery(".gsc-tabsArea div");
  tabs.each(function()
  {
    if(jQuery(this).html() == refinement)
    {
      jQuery(this).click();
    }
  });

The problem with this solution is that the desired divs aren't loaded
yet when this code is executed. The tabs are undefined and i can't
have the desired behavior.

Search criterias and sort options works fine tho.

Is there an event that i may not know of yet that would be able select
the right tab given on the #<refinement> passed through the URL ?

-- 
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en.

Reply via email to