javascript 小ネタwindowsオブジェクトをthisで取得する
- 作成日 2020.12.04
- 更新日 2022.07.26
- javascript
- javascript
![javascript 小ネタwindowsオブジェクトをthisで取得する](https://mebee.info/wp-content/uploads/2019/10/wp-2.png)
javascriptで、windowsオブジェクトをthisで取得する方法を掲載してます。
環境
- OS windows10 pro 64bit
- Apache 2.4.43
- ブラウザ chrome 103.0.5060.134
thisを利用
「window」オブジェクトは、「this」を使用しても利用することが可能です。
「window」オブジェクトを、コンソールに出力させてみると、以下の結果になり、
console.log( window );
実行結果
![](https://mebee.info/wp-content/uploads/2022/07/image-192-1024x539.png)
「this」を使用しても結果は、同じとなります。
console.log( this );
実行結果
![](https://mebee.info/wp-content/uploads/2022/07/image-193.png)
なので、「location」や「history」も、「this」で利用することができます。
console.log( this.location );
console.log( this.history );
-
前の記事
CentOs7 GlassFishをインストールする手順 2020.12.04
-
次の記事
python 集合(set)の値を削除する 2020.12.05
コメントを書く