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


以上です。

コメント

このブログの人気の投稿

投稿時間:2020-07-01 05:34:30 RSSフィード2020-07-01 05:00 分まとめ(37件)

投稿時間:2020-07-01 20:43:40 RSSフィード2020-07-01 20:00 分まとめ(81件)

投稿時間:2020-07-01 08:33:22 RSSフィード2020-07-01 08:00 分まとめ(49件)