Forum Moderators: open
Most of the time, the sites I work with have pop-up windows that I'd rather NOT see in the search engines -- enlargements of graphics and things like that. But I have one client who uses lots of pop-ups in their educational section, and the content is serious spider food.
Here's my newly found resolution:
The Pop-up Function
First I use a javascript function that allows me to give each pop-up window a different name (as we discussed in this thread [webmasterworld.com])
The Link:
<a href="url.html" onClick="popUpFunction('url.html','windowname');return false">Link Text</a>
That way, everyone running javascript gets the pop-up window, and the spiders see a vanilla link they can follow. Until I stumbled onto this, I was going crazy with complicated methods [they were a bit on the grey side ;-) ] to hide links from visitors but still give them to spiders.
The Pop-up Document
I include a script at the bottom that checks the window name. If it's not the one that the pop-up function assigns, then I know the visitor came from a search engine and is looking at an independent window, not a pop-up. So I use document.write to give the Search Engine visitor some serious navigation to get into the main site and the regular pop-up user gets a "Close Window" link. The finishing touch: a <noscript> tag gives site navigation links to the visitor with js turned off.
This technique quadrupled the content this client has to offer the Search Engines. I'm glad I found it, and I'm all ears for any improvements/simplifications.
A minor one, perhaps. This method would support the title attribute; title="Click here to go to blahblah"
?? Question: I'm combining the functions on the page you referenced. In the following, what does the term "popup" do? Isn't it a window name? And, if so, doesn't it need to match the name down in the body ('windowname')?
<head>
<SCRIPT LANGUAGE="Javascript1.2">
function puFunction(url, www, hhh)
{window.open(url,"popup",'width=' + www + ',height=' + hhh + ',left=50,top=50,screenX=50,screenY=50');
}
</SCRIPT>
</head>
<a href="http://somedomain.com/" title="Click here to go to blahblah"
onClick="puFunction('http://somedomain.com/','windowname');return false">Link Text</a>
(edited by: rcjordan at 4:44 pm (gmt) on Oct. 20, 2001
So far so good (they've just started to appear, this month, so I can't give a comprehensive answer yet.) They should do well because most of these pop-ups are tightly focused "expanded information" on one sub-sub-topic from the main page -- like "red widgets in Mexico". The pop-up's are very simple HTML pages and easily optimized.
> support the title attribute
Yes, it's a straight HTML link so the title attribute is fine. I had some concern that return false would deactivate the tool-tip, but it doesn't
> combining the functions on the page you referenced
Right, I could have been more complete -- you need to have the window name in the function's variable list to assign your chose unique name to each pop-up window. So an example of the function definition:
function cPop(url, windowname, www, hhh) {window.open(url,windowname,'width=' + www + ',height=' + hhh);
}
and the link:
<a href="url.html" title="click here for foo two" onClick="cPop('foo_two.html','foo_two',350,250);return false">foo two - more information</a>
and the sniffer javascript for the pop-up's document: else
if (window.name == "foo_two")
{document.write('<a href="javascript:window.close()">Close This Window</a>')
}
{document.write('whatever nav links coding you need')
}
> hallway pages for all the sites anyways
This particular "educational section" is only 12 principal pages but they each house 40 to 50 supplementary pop-ups. So this method makes each main page itself into a hallway page.
Since pages of mostly links became more and more suspect at the SEs, I started creating my content pages themselves as hallways wherever possible. It avoids any appearance of trying to persuade the algorithm, even for the most purist, academic definition.
The piece that eluded me was the ";return false" part. Without that you get a pop-up window when you click, but the main window also goes to the linked URL. Definitley NOT the desired effect.
The client with the site where I began using this technique called me this week to tell me that he was doing some academic research on Google, and found one of his own pop-ups at #1 for a two word phrase.
A check shows Google has indexed most of these pages. However, no other engine so far. Not that there are that many true spidering engines left ;)