window.open() の覚え書き

window.open() の覚え書き:


内容

1.オプション

2.外部pdfファイル表示


オプション

よく忘れがちなのでメモメモ


アドレスバー非表示

location=no 


urlのみ非表示

hideurlbar=yes 


Doneボタン文言変更

closebuttoncaption=完了 


ナビゲージョンボタン非表示

hidenavigationbuttons=yes 


ズームインズームアウト

EnableViewPortScale=yes 


外部PDFファイル表示


iOSの場合


オプションなし

ソースコード

window.open('http://xxxx.xx.xx/xxx.pdf', "_blank", ""); 
実行結果


ios_default.png



オプションあり

ソースコード

window.open('http://xxxx.xx.xx/xxx.pdf', "_blank", "location=no,toolbar=yes,EnableViewPortScale=yes,closebuttoncaption=完了,hidenavigationbuttons=yes"); 
実行結果
ios_options.png


Androidの場合


オプションなし

ソースコード

window.open('https://docs.google.com/viewer?url=http://xxxx.xx.xx/xxx.pdf&embedded=true', "_blank", ""); 
実行結果
android_default.png


オプションあり(PDF表示する際にGoogleDocViewを利用)

ソースコード

window.open('https://docs.google.com/viewer?url=http://xxxx.xx.xx/xxx.pdf&embedded=true', "_blank", "hideurlbar=yes,hidenavigationbuttons=yes"); 
実行結果


android_options.png


以上です。

コメント

このブログの人気の投稿

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-04-30 23:37:32 RSSフィード2021-04-30 23:00 分まとめ(42件)

投稿時間:2023-02-05 02:09:04 RSSフィード2023-02-05 02:00 分まとめ(9件)