<legend id='7ypZ5'><style id='7ypZ5'><dir id='7ypZ5'><q id='7ypZ5'></q></dir></style></legend>
      1. <tfoot id='7ypZ5'></tfoot>
      2. <small id='7ypZ5'></small><noframes id='7ypZ5'>

        <i id='7ypZ5'><tr id='7ypZ5'><dt id='7ypZ5'><q id='7ypZ5'><span id='7ypZ5'><b id='7ypZ5'><form id='7ypZ5'><ins id='7ypZ5'></ins><ul id='7ypZ5'></ul><sub id='7ypZ5'></sub></form><legend id='7ypZ5'></legend><bdo id='7ypZ5'><pre id='7ypZ5'><center id='7ypZ5'></center></pre></bdo></b><th id='7ypZ5'></th></span></q></dt></tr></i><div id='7ypZ5'><tfoot id='7ypZ5'></tfoot><dl id='7ypZ5'><fieldset id='7ypZ5'></fieldset></dl></div>
        • <bdo id='7ypZ5'></bdo><ul id='7ypZ5'></ul>
      3. 知道何时在 UIWebView 中加载了 AJAX

        时间:2023-11-09
      4. <tfoot id='KaEwu'></tfoot>

          <i id='KaEwu'><tr id='KaEwu'><dt id='KaEwu'><q id='KaEwu'><span id='KaEwu'><b id='KaEwu'><form id='KaEwu'><ins id='KaEwu'></ins><ul id='KaEwu'></ul><sub id='KaEwu'></sub></form><legend id='KaEwu'></legend><bdo id='KaEwu'><pre id='KaEwu'><center id='KaEwu'></center></pre></bdo></b><th id='KaEwu'></th></span></q></dt></tr></i><div id='KaEwu'><tfoot id='KaEwu'></tfoot><dl id='KaEwu'><fieldset id='KaEwu'></fieldset></dl></div>
          1. <small id='KaEwu'></small><noframes id='KaEwu'>

                <bdo id='KaEwu'></bdo><ul id='KaEwu'></ul>

                  <tbody id='KaEwu'></tbody>
              • <legend id='KaEwu'><style id='KaEwu'><dir id='KaEwu'><q id='KaEwu'></q></dir></style></legend>
                  本文介绍了知道何时在 UIWebView 中加载了 AJAX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 UIWebView 并且一个页面有一个 AJAX 组件,当用户单击按钮时,它的内容会发生变化.我如何知道内容何时加载到 UIWebView 中?

                  I have a UIWebView and one page has an AJAX component whose content changes when the user clicks a button. How can I know when the content has loaded inside the UIWebView?

                  推荐答案

                  你需要做两件事:

                  1. 在您的 JavaScript 代码中,使用 XMLHTTPRequest 信号表明 AJAX 请求已通过自定义 URL 完成:

                  1. In your JavaScript code, have the XMLHTTPRequest signal that the AJAX request is complete with a custom URL:

                  var req = new XMLHttpRequest();  
                  req.open('GET', 'http://www.mozilla.org/', true);  
                  req.onreadystatechange = function (aEvt) {  
                    if (req.readyState == 4) {  
                       if(req.status == 200) { 
                         window.location = "myspecialurl:foo"
                       }
                    }  
                  };  
                  

                • 在您的本机代码中,您需要实现一个 UIWebView 委托来侦听此自定义 URL:

                • In your native code, you'll need to implement a UIWebView delegate that listens for this custom URL:

                  - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 
                  {
                    if([[[request URL] absoluteString] isEqualToString:@"myspecialurl:foo"]) {
                       // Your code for when the AJAX request completes.
                       return NO;
                    }
                    return YES;
                  }
                  

                • 不保证此代码可以解析/编译,但应该让您知道如何去做.

                  No assurances this code parses/compiles but should give you the idea how to do it.

                  这篇关于知道何时在 UIWebView 中加载了 AJAX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在现有的 HTML 输入字段中加载图像/徽标 - UIWebView 下一篇:无法隐藏 iAd 横幅并在其位置显示 UIWebView

                  相关文章

                    <bdo id='ZPOI9'></bdo><ul id='ZPOI9'></ul>

                    <tfoot id='ZPOI9'></tfoot>
                  1. <small id='ZPOI9'></small><noframes id='ZPOI9'>

                      <legend id='ZPOI9'><style id='ZPOI9'><dir id='ZPOI9'><q id='ZPOI9'></q></dir></style></legend>

                      <i id='ZPOI9'><tr id='ZPOI9'><dt id='ZPOI9'><q id='ZPOI9'><span id='ZPOI9'><b id='ZPOI9'><form id='ZPOI9'><ins id='ZPOI9'></ins><ul id='ZPOI9'></ul><sub id='ZPOI9'></sub></form><legend id='ZPOI9'></legend><bdo id='ZPOI9'><pre id='ZPOI9'><center id='ZPOI9'></center></pre></bdo></b><th id='ZPOI9'></th></span></q></dt></tr></i><div id='ZPOI9'><tfoot id='ZPOI9'></tfoot><dl id='ZPOI9'><fieldset id='ZPOI9'></fieldset></dl></div>