携帯電話はフルブラウザーだけでなく、i-mode ブラウザー(他)でもなるべく見えるように変更して欲しいとのご依頼で、サイト共通メニュー ( JavaScript 使用 ) を削除。
通常のリンクメニューを新規作成し、全ページにコピペコピー&ペーストします。
ホームページビルダー上でやっていると面倒ですので、秀丸エディタを使い、JavaScript → 通常の HTML ソースへ全置換かけます。
いや、200 ページ以上あるので、全選択してコンテキストメニューで秀丸に送り、一度置換した後は、F3 キー → Alt+F4 → Y 、とします。
※ 「 検索(S) 」→ 「 grep して置換(@) 」で一発自動変換、と行きたかったのですが、Script を含んでいるとエラーになるようで、当てが外れました。
body タグ内だけでなく、head にある関連 JavaScript も削除。まあ残しておいても数パケット増えるだけではありますが。
(変更前)
<TD class="hpb-cnt-cell1" id="HPB_LAYOUT_LMH0" style="text-align : center;" align="center">
<DIV id="hpbsitemenutable999999999999"><SCRIPT language="JavaScript">
<!-- Site Menu
getHpbSiteMenu('HpbSitemenu/hpbsitemenutable999999999999.html','hpbsitemenutable999999999999');
// Site Menu -->
</SCRIPT></DIV>
</TD>
↓
(変更後)
<td class="hpb-cnt-cell1" id="HPB_LAYOUT_LMH0" style="text-align : center;" align="center" valign="center">
<table border="0" cellpadding="0" cellspacing="0" id="HPB_LINK_MENU_TABLE_888888888888" class="hpb-hmenu1">
<tbody>
<tr align="center">
<td class="hpb-hmenu1-idle1" align="center" valign="middle"><b><a href="index.html" class="hpb-hmenu1-link1">ホーム</a></b></td>
<td class="hpb-hmenu1-idle1" align="center" valign="middle"><b><a href="XXXXX.html" class="hpb-hmenu1-link1">XXX</a></b></td>
<td class="hpb-hmenu1-idle1" align="center" valign="middle"><b><a href="YYYYY.html" class="hpb-hmenu1-link1">YYY</a></b></td>
<td class="hpb-hmenu1-idle1" align="center" valign="middle"><b><a href="ZZZZZ.html" class="hpb-hmenu1-link1">ZZZ</a></b></td>
<td class="hpb-hmenu1-idle1" align="center" valign="middle"><b><a href="AAAAA.html" class="hpb-hmenu1-link1">AAA</a></b></td>
<td class="hpb-hmenu1-idle1" align="center" valign="middle"><b><a href="BBBBB.html" class="hpb-hmenu1-link1">BBB</a></b></td>
<td class="hpb-hmenu1-idle1" align="center" valign="middle"><b><a href="CCCCC.html" class="hpb-hmenu1-link1">CCC</a></b></td>
</tr>
</tbody>
</table>
</td>
共通メニューにしておくと、hpbsitemenutable999999999999.html を変更するだけで全ページに反映されるので楽なんですけどね。
(関連)
head セクションの Script 。
<SCRIPT type="text/javascript" language="JavaScript">
<!--HPB_SCRIPT_SITEMENU_11
//
// JavaScript
//
// Licensed Materials - Property of IBM
//
// 5724I83
//
// (C) Copyright IBM Corp. 1995, 2006 All Rights Reserved.
//
var hpb=new Object();
hpb.ContentLoader=function(url, divId, onload) {
this.url = url;
this.divId=divId;
this.request=null;
this.onload=onload;
this.onerror=this.defaultError;
this.loadSiteMenu(url);
}
hpb.ContentLoader.prototype={
loadSiteMenu:function(url){
if(window.ActiveXObject) {
// IE
try {
this.request = new ActiveXObject ("Msxml2.XMLHTTP");
} catch(e) {
this.request = new ActiveXObject ("Microsoft.XMLHTTP");
}
} else
if(window.XMLHttpRequest) {
// non-IE
this.request = new XMLHttpRequest();
}
if(this.request) {
try{
var loader=this;
this.request.onreadystatechange=function(){
loader.onReadyState.call(loader);
}
this.request.open('GET',url+"?cache="+(new Date()).getTime(), true);
this.request.send(null);
}catch( err) {
this.onerror.call(this);
}
}
},
onReadyState:function(){
var request = this.request;
var readyState = request.readyState;
if(readyState==4){
var httpStatus=request.status;
if(httpStatus==200 || httpStatus == 0) {
this.onload.call(this);
}else{
this.onerror.call(this);
}
}
},
defaultError:function() {
alert("サイト共通メニューの読み込みに失敗しました。\nメニューID : "+this.divId);
}
}
function getMenu(){
document.getElementById(this.divId).innerHTML = this.request.responseText;
}
function getHpbSiteMenu(menuURL, divId) {
var loader=new hpb.ContentLoader(menuURL, divId, getMenu);
}
//-->
</SCRIPT></HEAD>
いじょうです。
-
- -