質問編集履歴

2

JavaScriptのコードも載せました。

2018/07/16 04:02

投稿

agep31
agep31

スコア29

test CHANGED
File without changes
test CHANGED
@@ -94,6 +94,64 @@
94
94
 
95
95
  ```
96
96
 
97
+ html内のJavaScript
98
+
99
+ ```ここに言語を入力
100
+
101
+ <script type="text/javascript">
102
+
103
+ $(function() {
104
+
105
+ 'use strict';
106
+
107
+
108
+
109
+ // httpから始まるURL
110
+
111
+ var fullShareUrl = location.protocol + '//' + location.host + '/inttour/booking/csm/search/ISAP1100/init?courseNo=5HEP5NY1M0&deptYearMonth=201901&deptDay=22&planTypeCode=&planTypeBranchNo=&deptEndYearMonth=&deptEndDay=&isSearchTransition=true&cabinClass=0';
112
+
113
+
114
+
115
+ // facebookのdata-uri属性
116
+
117
+ $('#facebook-area').attr('href', 'http://www.facebook.com/share.php' + '?u=' + encodeURIComponent(fullShareUrl));
118
+
119
+
120
+
121
+ // Twitterリンクをセット
122
+
123
+ $('#twitter-link').attr('href', 'https://twitter.com/share?hashtags=' + encodeURIComponent('ANA,ANAツアー,ANA_海外ツアー,ANA_海外旅行,旅行,Travel') + '&text=' + encodeURIComponent(document.title) + '&url=' + encodeURIComponent(fullShareUrl));
124
+
125
+
126
+
127
+ // google+のdata-href属性
128
+
129
+ $('#google-plus-area').attr('data-href', fullShareUrl);
130
+
131
+
132
+
133
+ // メール
134
+
135
+ // mailto:?subject=[件名]&body=[本文]%0d%0a[URL]
136
+
137
+ // 件名はtitle, 本文はdescription
138
+
139
+ var description = $('meta[name="description"]').attr('content');
140
+
141
+ var mailHref = 'mailto:?subject=' + encodeURIComponent(document.title) + '&body='+ encodeURIComponent(description + '\r\n' + fullShareUrl);
142
+
143
+ $('#mail-link').attr('href', mailHref);
144
+
145
+
146
+
147
+
148
+
149
+ });
150
+
151
+ </script>
152
+
153
+ ```
154
+
97
155
 
98
156
 
99
157
  ### 補足情報(FW/ツールのバージョンなど)

1

URLを開示しました。

2018/07/16 04:02

投稿

agep31
agep31

スコア29

test CHANGED
File without changes
test CHANGED
@@ -40,7 +40,9 @@
40
40
 
41
41
 
42
42
 
43
- $url = "hoge.co.jp"
43
+ $url ="https://www.ana.co.jp/inttour/booking/csm/search/ISAP1100/initcourseNo=5HEP5NY1M0&planTypeCode=++&planTypeBranchNo=++&deptYearMonth=201901&deptDay=22&deptEndYearMonth=&deptEndDay=&isSearchTransition=true&cabinClass=0&coopSiteCode="
44
+
45
+ ;
44
46
 
45
47
  $html = file_get_contents($url,false,$context);
46
48