0

サイトにボタンを挿入し$refer = $_SERVER['HTTP_REFERER'];、紹介を取得するために使用しますが、iframeが埋め込まれているURLを常に表示します。元の紹介をiframeに送信する方法はありますか?ユーザーがFacebookやTwitterなどから来ているかどうかを知りたいのですが、常に自分のURLを送ってくれるので、次のようなものを試します。

    <script>
    var myval = ""+escape(parent.document.referer);

    $.ajax({
      type: 'POST',
      url: 'downs.php',
      data: {'variable': myval},
    });
    </script>

私は間違っていることを知っていますが、親の紹介を私のphpに送信する方法がわかりません

4

1 に答える 1

-1
you can try this js code this will help you to get parent url

var pathname = window.parent.location.href
于 2013-01-28T07:50:08.270 に答える