Created
July 9, 2011 17:40
-
-
Save nissuk/1073781 to your computer and use it in GitHub Desktop.
WSH: jQuery 1.6.2を使用する例 (WSF)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<job> | |
<!-- | |
WSHでjQuery 1.6.2を使用する例 (Shift_JISで保存してください…) | |
# 元プログラム | |
http://d.hatena.ne.jp/hirataka522/20080806/1218031483 | |
# 使用例(コマンドプロンプト) | |
cscript kion.wsf 大垣 | |
--> | |
<script language="JScript"> | |
var html = new ActiveXObject("htmlfile"); | |
// 1. | |
html.write('<html></html>'); | |
var window = html.parentWindow; | |
var navigator = window.navigator; | |
var document = window.document; | |
var location = document.location; | |
// 2. | |
window.ActiveXObject = ActiveXObject; | |
// 3. | |
var setTimeout = function(func, delay) { return window.setTimeout(func, delay) }; | |
</script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" /> | |
<script language="JScript"> | |
var url = "http://www.google.co.jp/search?q=天気 "+ WScript.Arguments.item(0); | |
var $ = window.$; | |
// 4. | |
$.support.cors = true; | |
$.ajax({ | |
url: url, | |
async: false, | |
complete: function(res){ | |
html.write(res.responseText); | |
// 5. | |
WScript.Echo($('div.g table table td:contains("°C")').text()); | |
} | |
}); | |
</script> | |
</job> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WSH: jQuery 1.6.2を使用する もどうぞ