| |
| Internet Explorer | Netscape Navigator | Opera | iCab | Safari | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 3.0x | 4.0x | 4.5 | 5.0x | 5.5 | 6.0 | 2.0x | 3.0x | 4.0x | 4.x | 6.0 | 7.0 | 6.0 | 7.0 | 2.x | 1.0 | 1.1 | 1.2 | |
| Windows | × | × | - | ○ | ○ | ○ | × | × | × | × | × | × | × | × | - | - | - | - |
| Macintosh | × | × | × | ○ | - | - | × | × | × | × | × | × | × | × | × | × | × | × |
| UNIX | - | - | - | - | - | - | × | × | × | × | × | × | × | × | - | - | - | - |
| 説 明 | テキストのみ抽出するにはcreateTextRange()でオブジェクトを作成しtextプロパティを読み出し、それをドキュメントに入れます。この時にvoid()で囲んでしまうと何も起こらなくなるため、ここではvoid()では囲みません。 |
|---|---|
| サンプル | <html> <head> <title>ページ内容のテキストのみ抽出する</title> </head> <body> ページ内容のテキストのみ抽出するブックマークレットです。<br> ページ内の <a href="javascript:document.body.innertText=document.body.createTextRange().text;">テキストを抽出</a> します。 </body> </html> |
| 補足説明 | なし |
|
■サンプルスクリプトを実行する >>実行 ■各ブラウザでの動作結果を見る >>View! |
