teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

誤字修正

2019/07/10 07:52

投稿

hirahiro
hirahiro

スコア24

title CHANGED
File without changes
body CHANGED
@@ -13,7 +13,7 @@
13
13
  ```jQuery
14
14
  ;(function($){
15
15
  // function(option) からアロー関数へ変更
16
- $.fn.smoothScroll = ( option ) => {
16
+ $.fn.testFunction = ( option ) => {
17
17
 
18
18
  const defaults = $.extend({
19
19
  param1 : '',

1

誤字修正

2019/07/10 07:52

投稿

hirahiro
hirahiro

スコア24

title CHANGED
File without changes
body CHANGED
@@ -1,5 +1,5 @@
1
1
  ### 経緯
2
- 利用していたjQueryのプラグインをES6の記述で修。thisの参照先の違いによりエラーが起きてしまいました。
2
+ 利用していたjQueryのプラグインをES6の記述で修。thisの参照先の違いによりエラーが起きてしまいました。
3
3
 
4
4
  ### ソース
5
5
  ```html
@@ -15,13 +15,13 @@
15
15
  // function(option) からアロー関数へ変更
16
16
  $.fn.smoothScroll = ( option ) => {
17
17
 
18
- var defaults = $.extend({
18
+ const defaults = $.extend({
19
19
  param1 : '',
20
20
  param2 : '',
21
21
  },option);
22
22
 
23
23
  // 参照先が違う
24
- var self = $(this);
24
+ let self = $(this);
25
25
 
26
26
  };
27
27