0

Issuu を使用してカタログのデジタル版を公開している顧客向けの 2 つのオークション Web サイトの世話をしています。過去 48 時間以内に、どちらのサイトもカタログの Issuu バージョンへのリンクを表示していないと報告しています。どちらも同じ方法を使用して、Issuu でカタログが利用可能かどうかをテストし、Web サーバー (両方のサイトが同じサーバー上にあります) から XHR ヘッド リクエストを送信し、応答があれば、サイトはリンクをスワップします。

コードは次のとおりです。これは従来の ASP であり、数日前までは完全に機能し、Issuu だけでなく、Google、MS、自分の Web サイトなど、テストした他のサイトでも機能します。

何か案は?

コードは次のとおりです....

Function InsertIssuuLink(s_saleno)

'$! Looks for designated folder on remote site 
dim xmlhttp
dim s_targetURL
dim s_tmp

InsertIssuuLink = ""

s_saleno = trim(s_saleno)

s_targetURL = "http://issuu.com/artcurialbpt/docs/" & s_saleno & ""

'$! Create instance of Server XHR object

set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")

'$! Perform header request - most efficient way of determining if folder / item is present

xmlhttp.open "HEAD", s_targetURL, true

xmlhttp.send

'$! Ignore errors - better for page to finish loading without link than to throw an error
On Error Resume Next

'$! Wait the waitForResponse no of seconds if we've not gotten the data yet (readyState = 4 : request completed)
If xmlhttp.readyState <> 4 then

    xmlhttp.waitForResponse 5

End If  

If Err.Number <> 0 then

    InsertIssuuLink = ""

Else    


    If (xmlhttp.readyState <> 4) Or (xmlhttp.Status <> 200) Then
        'Abort the XMLHttp request
        xml.Abort
        InsertIssuuLink = ""

    Else

        InsertIssuuLink = "<a href=""" & s_targetURL & "?e=6268161/"" onclick=""pageTracker._trackPageview ('/outgoing/issuu/" & s_saleno & "');window.open(this.href);return false;"">Consulter le E-Catalogue</a><br />"
        b_show_catalogue_section = true

    End If

End If      


End Function
4

0 に答える 0