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

質問編集履歴

2

コードを加えました。

2016/01/29 05:49

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -10,4 +10,44 @@
10
10
 
11
11
  以上、独学初心者なので調べても専門用語ばかりで、その都度その用語について調べていると何を調べていたかわからなくなりここで質問させて頂きました。
12
12
 
13
- どうかお助けください。。
13
+ どうかお助けください。。
14
+
15
+
16
+
17
+ ```java script
18
+ <script type="text/javascript">
19
+ $(function(){
20
+ function wSearch(){$('.word').each(function(){
21
+ var word = $(this).text();
22
+
23
+ var contents = 'http://xxxx/' + word;
24
+ $(this).siblings('.contents').load(contents , function(){
25
+ //略
26
+ });
27
+ });
28
+ }
29
+
30
+ $("#word").on("blur",function(){
31
+ var fome_x_name = $(this).val();
32
+ $('h1.word').text(fome_x_name)
33
+ wSearch();
34
+ });
35
+ });
36
+ </script>
37
+ ```
38
+
39
+ ```html
40
+ <body>
41
+ <div id="input">
42
+ <input type="text" name="word" id="word">
43
+ </div>
44
+ <div id="wrap">
45
+ <h1 class="word"></h1>
46
+ <div class="contents"></div>
47
+ </div>
48
+ </body>
49
+ ```
50
+
51
+ グチャグチャなコードですみません。。
52
+ あと、できればキーボードのエンターを押して検索もできるようにしたいのですが、上手くいきません。
53
+ 現在、検索窓のフォーカスを外すことで起動させています。

1

タグ付加

2016/01/29 05:49

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
File without changes