大网数据广告活动
网站运营与故障问答

How to make a <select> navigation search engine friendly?

· 52CE 我爱测

I have part of navigation in an HTML page that is routed by a select : <select id="archive" name="archive"> <option value="">Select an option</option> <option value="1">001</option> <option value="2">002</option> <option value="3…

问题原文

原帖链接 · al404IT · CC BY-SA 3.0

I have part of navigation in an HTML page that is routed by a select:

<select id="archive" name="archive">
 <option value="">Select an option</option>
 <option value="1">001</option>
 <option value="2">002</option>
 <option value="3">003</option>
</select>

I can't change the design, but I'm pretty sure that search engines can't navigate to URLs generated on select change by jQuery.

Would this solve the issue?

<select id="archive" name="archive">
 <option value="">Select an option</option>
 <option value="1"><a href="http://mylink.com/01">001</a></option>
 <option value="2"><a href="http://mylink.com/02">002</a></option>
 <option value="3"><a href="http://mylink.com/03">003</a></option>
</select>

There isn't any dynamic sitemap on the website.

已采纳解答

原帖链接 · DocRoot · CC BY-SA 3.0

I wouldn't be surprised if Google is already able to cope with this navigation "pattern", as it is reasonably common and Google is "good" at processing JavaScript these days.

However, this could be made more accessible (for both users and search engine bots) if you ensure that these form elements are indeed contained within a form, with a specific action and submit button (if you aren't doing this already). All these additional form elements can be overridden/hidden with JavaScript at the time your page is initialised.

There isn't any dynamic sitemap on the website.

Although this is certainly one instance where a sitemap (XML and/or HTML) would be beneficial.

Making sure these URLs are linked to from some other place would also be advisable.

<option value="1"><a href="http://mylink.com/01">001</a></option>

This doesn't look like a good idea. Is this even valid HTML? And if it's not valid HTML then browser behaviour could be erratic, causing you more problems.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-12-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。