このコードは、ブックマークレットとしてそれを使用する場合は動作しません:
javascript:if%20(document.forms['aspnetForm']['MSOLayout_InDesignMode']%20!=%20null)%20document.forms['aspnetForm']['MSOLayout_InDesignMode'].value%20=%201;if%20(document.forms['aspnetForm']['MSOAuthoringConsole_FormContext']%20!=%20null)%20document.forms['aspnetForm']['MSOAuthoringConsole_FormContext'].value%20=%201;theForm.submit();
私は無地のJavascriptに変換しようとしたが、それは私のFirefoxのJavaScriptコンソールでは動作しません。
SP_EditPage: function(){
var thisdocument = window.content.document;
if (thisdocument.forms['aspnetForm']['MSOLayout_InDesignMode'] != null)
thisdocument.forms['aspnetForm']['MSOLayout_InDesignMode'].value = 1;
if (thisdocument.forms['aspnetForm']['MSOAuthoringConsole_FormContext'] != null)
thisdocument.forms['aspnetForm']['MSOAuthoringConsole_FormContext'].value = 1;
theForm.submit();
},
誰もが普通のjavascriptで動作させることができれば、私は非常に興味があります!それは私に語った: エラー:例外TypeError:ブックマークレットは、この仲間のサイトから来た2
:Javascriptのコマンド ライン:thisdocument.forms.aspnetFormは未定義 ソースファイルである。ここ http://blog.mastykarz.nl/sharepoint-developer-bookmarklets/
は別のものです。サイドバーを開いたまま編集ページを開始します。これは私にとってうまくいく:
SP_EditPage: function(){
var thisdocument = getBrowser().contentWindow.document;
if(thisdocument.location.href.search('ToolPaneView=') == -1){
if (thisdocument.location.search.indexOf('?') == 0){
thisdocument.location=(thisdocument.location.href + '&ToolPaneView=2');
}else{
thisdocument.location=(thisdocument.location.href + '?ToolPaneView=2');
}
} else {
thisdocument.location=thisdocument.location.href;
}
},
偉大な解決策!、唯一の欠点は、すべてのページレイアウトにこのタグを含める必要があることです。私はそれをマスターページに挿入できませんでしたが、私はそれを愛しています、そんなにたくさんの^ _^ –