English 中文(简体)
B. 侦查随后航行成功的方法
原标题:Method to detect if subsequent navigation will succeed

页: 1 缩略语 然后立即将用户转至网上<代码> 所在地.href=http://server/path>。

www.un.org/Depts/DGACM/index_spanish.htm 是否有办法探测航行是否成功(或探测途径,如果是<_em> 后>)。

想法:

  • XHR to the url to get HTTP response code before navigating to url. (Permission issue as the sites are not identical: file:// -> http://)
  • SCRIPT element to a known path at url.
  • Access url in FRAME. Then reload parent once it succeeds from either the result page or from the HTA.

注:

URL将是一个动态的网页(服务器),放在服务器上。 静态内容(温度等)以不同方式主办。 通过核实图像,它没有保证真正的陶器。 请回答反映这一差异。 (图瓦卢!)

最佳回答

The CALLING page cannot directly know if its navigation will succeed or fail. Different methods can be used to increase the likelihood that it will occur, but ultimately it may or may not succeed.

问题回答

如果你能够进入目标网页,就在网页上向登记成功负荷的电传服务器张贴一张纸(onload)。

视您的技术选择而定,从网页上登出可以简单地向服务器网站服务,在中央存放处登记成功装载(即数据库)。 你的空运协会可以定期检查数据库的装载状况,并相应采取行动。

概述:

  1. A web service registering load status for a page request. Save the loading status in a central database
  2. On the loading web page call this web service after the page has fully loaded. On error set the status likewise.
  3. In your HTA create a timer that checks (and displays) loading status. And acts according to the final status.

浏览服务器的图像并听取onloadonerror/活动。 形象只能是一种透明的图象。

<img src="http://server/transparent.gif" onload="setServerAvailable(true);" onerror="setServerAvailable(false);" />

<><>Edit>: 您可以装上一栏。 可以通过 Java本监测页数。 在与一项HTA合作时,你不需要担心Same Origin政策。 除此法外,还将HTA装上,点击 but子。 阁下认为,即使框架内容属于另一个领域,你还是能够修改:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Test Same Origin Policy in HTA</title>
        <script type="text/javascript">
            function modifyFrame()
            {
                var fr = document.body.getElementsByTagName("iframe")[0];
                fr.contentWindow.document.body.innerHTML = 
                    "Cross domain scripting works in HTA";
            }
        </script>
    </head>
    <body>
        <iframe src = "http://stackoverflow.com/questions/7940913/"></iframe>
        <br /><br />
        <button onclick="modifyFrame()">Modify cross-domain frame content</button>
    </body>
</html>




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.