Francois wrote:
> David,
> Thanks for the advice. I believe I was not clear enough, since your
> code update the url when one clicks on a link. I am looking for the
> other direction: how to modify the exhibit when a link with # in it,
> is used.
>
> Using
> "javascript:window.location='exhibit.html#fp_pub=Elsevier';applyRestrictions
> ();" in href attribute of an "a" link do what I search. But I was
> wondering if I could have normal url in href and have an exhibit event
> which would call the applyRestrictions function.
>
> See http://www.unifr.ch/dokpe/paperj/exhibit.html
>
> So is there a cleaner way to use the # trick ?
>
Oh, I see. No, I can't think of a much cleaner way. This is just
slightly better:
<a href="exhibit.html#fp_pub=Elsevier" onclick="return
handleClick(event, 'fp_pub', 'Elsevier')"> ... </a>
function handleClick(evt, facetID, choice) {
... restrict the facet yourself ...
document.location.hash=facetID + "=" + choice;
evt.preventDefault();
return false;
}
I'm not sure if the last 3 lines of the function's body are necessary.
David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" 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/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---