![]() |
| Snap Preview Anywhere javascript snippet |
|
Allen
Forum Regular
|
This question is in reference to the fairly new (and super cool) search engine called Snap at http://www.snap.com/ which offers a free feature called "Snap Preview Anywhere" which will show the viewer a quick snapshot of the webpage associated with a hyperlink. In other words, before a viewer clicks a link, they can see the webpage it goes to. It is somewhat similar to the 'binoculars' of Ask. com and seemingly would be a nifty feature for my directories. (pardon my use of 'nifty'... jargon of the early 1950s)
Anyway, since I don't want this 'preview' to be displayed for my internal links (being then a stupid feature), Snap suggested this:
Well, this snippet doesn't work (I don't like the manual option) and I think it has to do with this part: (/^http:\/\/www\.example\.com/) Of course, for my site I tried: (/^http:\/\/www\.matrixbookstore\.biz/) Is it because my internal links don't spell out the whole URL? For example: <a href="idiot.htm">idiot</a> I tried several variations but since I'm not smart enough to be a hack, nothing works... any suggestions? |
|||||||||||||
|
|
||||||||||||||
|
Allen
Forum Regular
|
Problem solved... for Explorer 7 at least. By revising this portion thusly, it worked:
if(links[l].href.match(/matrixbookstore\.biz/)){ On the other hand, Firefox wouldn't ignore the internal links if they're enclosed in brackets or situated within the borders. For all other links it did work. I tried inserting the caret (^) character thusly: (/^matrixbookstore\.biz/), but then not even Explorer 7 would recognize it. Maybe I need an 'excape'... another backslash (\) or something? UPDATE: While it worked perfectly for Explorer 7 at first, but now, for some reason, it isn't working for those links on the right side and bottom borders. It only works for those links within the body and left border. P.S. As instructed, I placed the code just before the (/body) tag. I also tried placing in before the (/head) tag but then the script wouldn't work at all. I'm hornswoggled! |
||||||||||||
|
|
|||||||||||||
| body.onload = nopreview(); |
|
comprug
Forum Regular
|
Allen, don't quote me on this, but this is what I would do. In the opening body tag:
Now before the end of the body tag:
Thanks, [/i] |
||||||||||||||||
|
|
|||||||||||||||||
|
Allen
Forum Regular
|
Thank you Ben!! It works perfectly for Explorer 7... see http://www.matrixbookstore.biz/azcolleges.htm (changed just this one webpage)
However, it doesn't work at all for Firefox. Like you said though, FF might be processing the script differently. And, as you suspected, none of my internal links have the 'http://www.matrixbookstore.biz/' portion. In other words: <a href="example.htm">example</a> whereas my external links would be: <a href="http://www.example.edu/">example</a> While I'm happy with this, any ideas for FF without compromising IE? |
||||||||||||
|
|
|||||||||||||
| Some minor changes |
|
comprug
Forum Regular
|
Allen, try this:
|
||||||||||||||
|
|
|||||||||||||||
|
Allen
Forum Regular
|
No difference Ben... it works for IE but not for Firefox.
I left the <body onload="noSnapshot();"> in place and refreshed the page (whereby it wasn't a cache). Nonetheless Ben, I'm still happy with the existing fix... just thought you might have a quick idea off the top of your head. You've already put too much time in this for which I thank you. |
||||||||||||
|
|
|||||||||||||
| Snap Preview Anywhere javascript snippet |
|
||
|


