これはAjaxで可能かどうか知らせてくれますか?私は外部サイトをページにロードしてから、jQuery、jScript、PHP、またはいくつかのメソッドを使用して、ちょうどロードした外部サイトページのクリックをシミュレートします。クリックをシミュレートするAjax
サイトでは、伝統的なポスト/取得
<script type="text/javascript" language="javascript">
//<![CDATA[
function FriendCenterObject() {
var fcAction = function(actionUrl, gamerTag, responseHandler) {
responseHandler = responseHandler || function(response) {
if (response.status != 0) {
DisplayMessageDialog('Error', response.view, 'Close', null, MessageLevelType.Error);
}
else {
DisplayMessageDialog('Message', response.view, 'Close', FriendCenter.RefreshContentAction);
}
}
$.post(actionUrl, { 'gamerTag': gamerTag }, responseHandler);
};
this.AddFriend = function(gamerTag) {
gamerTag = $.trim(gamerTag); // trim leading and trailing whitespaces
if (gamerTag != "") {
fcAction('/en-US/FriendCenter/SendFriendRequest', gamerTag);
}
return false;
};
this.RefreshContentAction = function(){};
};
var FriendCenter = new FriendCenterObject();
//]]>
</script>
を許可しません、これは私はいくつかのより多くのinvestagatingとその間違いなく使用してなかった私は、ユーザーが
<a href="#" onclick="FriendCenter.AddFriend('mirco')">Add to Friends List</a>
をクリックできるようにしたいのリンクですContent-Typeのコンテンツタイプを持つPostメソッド:application/json
これを必要とする答えにもう少し詳しく。あなたはあなたのスクリプトを含むページに外部サイトを "読み込んでいます" - これはiframeかAJAXの何らかの要求ですか? –
あなたのドメイン内ですか?もしそうでなければ、あなたはできないはずです。外部サイトのクリックを自動化する必要がある場合は、http://seleniumhq.org/ – Chris
をご覧ください。私はそれに似た何かをする必要があるときにそれを使いました。 http://stackoverflow.com/questions/2149867/webbrowsing-in-c-libraries-tools-etc-anything-like-mechanize-in-perl – Jason