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

質問編集履歴

1

コードブロックで囲みました。

2017/02/15 11:49

投稿

Hyonta
Hyonta

スコア36

title CHANGED
File without changes
body CHANGED
@@ -1,6 +1,7 @@
1
1
  index.htmlにアクセスがあったら、JavaScriptでURLから演算式を取り出して計算結果を表示するようにしたいです。
2
2
  今、以下のような状態なのですがアドバイスをお願い致します。
3
3
 
4
+ ```html
4
5
  <!DOCTYPE html>
5
6
  <html>
6
7
  <head></head>
@@ -17,13 +18,14 @@
17
18
  </script>
18
19
  </body>
19
20
  </html>
21
+ ```
20
22
 
21
23
  以下のようにアクセスがあります。
22
- curl 'http://hogehoge.com/calc?abc'
24
+ curl 'http://example.co.jp/calc?abc'
23
25
  ERROR
24
- curl 'http://hogehoge.com/calc?1+1'
26
+ curl 'http://example.co.jp/calc?1+1'
25
27
  2
26
- curl 'http://hogehoge.com/calc?1+2*3'
28
+ curl 'http://example.co.jp/calc?1+2*3'
27
29
  7
28
- curl 'http://hogehoge.com/calc?(1+2)*3'
30
+ curl 'http://example.co.jp/calc?(1+2)*3'
29
31
  9