PhoneGap InAppBrowser

90001 단어 PhoneGap
InAppBrowser 웹 브 라 우 저 보 기 를 표시 할 때 호출 window.open() 하거나 연결 을 열 면 합 니 다.
var ref = window.open('http://apache.org', '_blank', 'location=yes');

주: InAppBrowser 창 은 표준 웹 브 라 우 저 와 유사 하 며, 콜 도 바 의 Api 에 접근 할 수 없습니다.
설명 하 다.
호출 된 물건 window.open.
방법.
  • addEventListener
  • removeEventListener
  • close
  • show
  • executeScript
  • insertCSS

  • 접근 기능
    3.0 판 에서 콜 도 바 는 외 장 프로그램 으로 장치 급 Api 를 실현 했다.CLI plugin 명령 을 사용 하여 명령 열 인터페이스 에 설명 합 니 다. 프로젝트 를 추가 하거나 삭제 할 수 있 습 니 다. 이 기능 은:
        $ cordova plugin add org.apache.cordova.inappbrowser
        $ cordova plugin ls
        [ 'org.apache.cordova.inappbrowser' ]
        $ cordova plugin rm org.apache.cordova.inappbrowser
    

    이 명령 들 은 모든 맞 춤 형 플랫폼 에 적용 되 지만 다음 과 같은 특정한 플랫폼 설정 을 수정 합 니 다.
  • (android app/res/xml/config.xml
     name="InAppBrowser">
         name="android-package" value="org.apache.cordova.InAppBrowser" />
    
    
  • (iOS config.xml
     name="InAppBrowser">
         name="ios-package" value="CDVInAppBrowser" />
    
    
  • Windows Phone 7, 8 개 (재 config.xml
     name="InAppBrowser" />
    
  • 일부 플랫폼 은 이 기능 을 지원 할 수 있 으 며 특별한 설정 이 필요 하지 않 습 니 다. 개술 부분 에서 플랫폼 지원 을 참조 하 십시오.
    addEventListener
    이벤트 에 차단 기 를 추가 합 니 다 InAppBrowser.
    ref.addEventListener(eventname, callback);
    
  • ref: 참조 InAppBrowser 창 (InAppBrowser)
  • 사건 이름: 사건 수사 (문자열)
  • loadstart: 트리거 이벤트 InAppBrowser 에서 URL 을 불 러 오기 시작 합 니 다.
  • loadstop: 트리거 이벤트 InAppBrowser 가 URL 을 불 러 옵 니 다.
  • loaderor: 트리거 이벤트 InAppBrowser 가 URL 을 불 러 오 는 중 오류 가 발생 했 습 니 다.
  • 종료: 이벤트 InAppBrowser 가 발생 하면 창 을 닫 습 니 다.
  • 압축 파일: 실행 시 이 이벤트 의 함 수 를 촉발 합 니 다. 이 함 수 는 InAppBrowserEvent 아 이 템 을 매개 변수 로 합 니 다.
  • 지원 플랫폼
  • Android 시스템
  • 블랙 베 리 폰
  • iOS
  • Windows Phone 7 과 8
  • 빠 른 예시
    var ref = window.open('http://apache.org', '_blank', 'location=yes');
    ref.addEventListener('loadstart', function() { alert(event.url); });
    

    완전한 예시
    
    
      
        </span><span class="pln">InAppBrowser</span><span class="pln">.</span><span class="pln">addEventListener</span><span class="pln"> Example</span><span class="tag"/><span class="pln">
    
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"cordova.js"</span><span class="tag">></script></span><span class="pln">
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="tag">></span><span class="pln">
    
        </span><span class="com">// Wait for device API libraries to load</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">"</span><span class="str">deviceready</span><span class="str">"</span><span class="pun">,</span><span class="pln"> onDeviceReady</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
    
        </span><span class="com">// device APIs are available</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> onDeviceReady</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             </span><span class="kwd">var</span><span class="pln"> ref </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
             ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstart'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> alert</span><span class="pun">(</span><span class="str">'start: '</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> event</span><span class="pun">.</span><span class="pln">url</span><span class="pun">);</span><span class="pln"> </span><span class="pun">});</span><span class="pln">
             ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> alert</span><span class="pun">(</span><span class="str">'stop: '</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> event</span><span class="pun">.</span><span class="pln">url</span><span class="pun">);</span><span class="pln"> </span><span class="pun">});</span><span class="pln">
             ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loaderror'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> alert</span><span class="pun">(</span><span class="str">'error: '</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> event</span><span class="pun">.</span><span class="pln">message</span><span class="pun">);</span><span class="pln"> </span><span class="pun">});</span><span class="pln">
             ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'exit'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> alert</span><span class="pun">(</span><span class="pln">event</span><span class="pun">.</span><span class="pln">type</span><span class="pun">);</span><span class="pln"> </span><span class="pun">});</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="tag"></script></span><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
    </span><span class="tag"/><span class="pln">
    </span></span></code></pre> 
      <h1>removeEventListener</h1> 
      <blockquote> 
       <p>        <code>InAppBrowser</code>.</p> 
      </blockquote> 
      <pre><code><span class="kwd">ref</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="pln">eventname</span><span class="pun">,</span><span class="pln"> callback</span><span class="pun">);</span><span class="pln">
    </span></code></pre> 
      <ul> 
       <li> <p><strong>ref</strong>:    <code>InAppBrowser</code>   。<em>() InAppBrowser</em></p> </li> 
       <li> <p><strong>    </strong>:         。<em>(  )</em></p> 
        <ul> 
         <li><strong>loadstart</strong>:       <code>InAppBrowser</code>        URL。</li> 
         <li><strong>loadstop</strong>:       <code>InAppBrowser</code>        URL。</li> 
         <li><strong>loaderror</strong>:       <code>InAppBrowser</code>          URL。</li> 
         <li><strong>  </strong>:       <code>InAppBrowser</code>     。</li> 
        </ul></li> 
       <li> <p><strong>  </strong>:             。      <code>InAppBrowserEvent</code>   。</p> </li> 
      </ul> 
      <h2>     </h2> 
      <ul> 
       <li>Android   </li> 
       <li>    </li> 
       <li>iOS</li> 
       <li>Windows Phone 7   8</li> 
      </ul> 
      <h2>     </h2> 
      <pre><code><span class="kwd">var</span><span class="pln"> </span><span class="kwd">ref</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">var</span><span class="pln"> myCallback </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> alert</span><span class="pun">(</span><span class="kwd">event</span><span class="pun">.</span><span class="pln">url</span><span class="pun">);</span><span class="pln"> </span><span class="pun">}</span><span class="pln">
    </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstart'</span><span class="pun">,</span><span class="pln"> myCallback</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'loadstart'</span><span class="pun">,</span><span class="pln"> myCallback</span><span class="pun">);</span><span class="pln">
    </span></code></pre> 
      <h2>     </h2> 
      <pre><code><span class="dec"><span class="pln">
    </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
        </span><span class="tag"><title/></span><span class="pln">InAppBrowser</span><span class="pln">.</span><span class="pln">removeEventListener</span><span class="pln"> Example</span><span class="tag"/><span class="pln">
    
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"cordova.js"</span><span class="tag">></script></span><span class="pln">
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="tag">></span><span class="pln">
    
        </span><span class="com">// Wait for device API libraries to load</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">"</span><span class="str">deviceready</span><span class="str">"</span><span class="pun">,</span><span class="pln"> onDeviceReady</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
    
        </span><span class="com">// Global </span><span class="com">InAppBrowser</span><span class="com"> reference</span><span class="pln">
        </span><span class="kwd">var</span><span class="pln"> iabRef </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
    
        </span><span class="kwd">function</span><span class="pln"> iabLoadStart</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            alert</span><span class="pun">(</span><span class="pln">event</span><span class="pun">.</span><span class="pln">type </span><span class="pun">+</span><span class="pln"> </span><span class="str">' - '</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> event</span><span class="pun">.</span><span class="pln">url</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="kwd">function</span><span class="pln"> iabLoadStop</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            alert</span><span class="pun">(</span><span class="pln">event</span><span class="pun">.</span><span class="pln">type </span><span class="pun">+</span><span class="pln"> </span><span class="str">' - '</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> event</span><span class="pun">.</span><span class="pln">url</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="kwd">function</span><span class="pln"> iabLoadError</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            alert</span><span class="pun">(</span><span class="pln">event</span><span class="pun">.</span><span class="pln">type </span><span class="pun">+</span><span class="pln"> </span><span class="str">' - '</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> event</span><span class="pun">.</span><span class="pln">message</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="kwd">function</span><span class="pln"> iabClose</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             alert</span><span class="pun">(</span><span class="pln">event</span><span class="pun">.</span><span class="pln">type</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'loadstart'</span><span class="pun">,</span><span class="pln"> iabLoadStart</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> iabLoadStop</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'loaderror'</span><span class="pun">,</span><span class="pln"> iabLoadError</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'exit'</span><span class="pun">,</span><span class="pln"> iabClose</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="com">// device APIs are available</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> onDeviceReady</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             iabRef </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstart'</span><span class="pun">,</span><span class="pln"> iabLoadStart</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> iabLoadStop</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'loaderror'</span><span class="pun">,</span><span class="pln"> iabLoadError</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'exit'</span><span class="pun">,</span><span class="pln"> iabClose</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="tag"></script></span><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
    </span><span class="tag"/><span class="pln">
    </span></span></code></pre> 
      <h1>  </h1> 
      <blockquote> 
       <p>   <code>InAppBrowser</code>   。</p> 
      </blockquote> 
      <pre><code><span class="kwd">ref</span><span class="pun">.</span><span class="pln">close</span><span class="pun">();</span><span class="pln">
    </span></code></pre> 
      <ul> 
       <li><strong>ref</strong>:    <code>InAppBrowser</code>   <em>(InAppBrowser)</em></li> 
      </ul> 
      <h2>     </h2> 
      <ul> 
       <li>Android   </li> 
       <li>    </li> 
       <li>iOS</li> 
       <li>Windows Phone 7   8</li> 
      </ul> 
      <h2>     </h2> 
      <pre><code><span class="kwd">var</span><span class="pln"> </span><span class="kwd">ref</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">close</span><span class="pun">();</span><span class="pln">
    </span></code></pre> 
      <h2>     </h2> 
      <pre><code><span class="dec"><span class="pln">
    </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
        </span><span class="tag"><title/></span><span class="pln">InAppBrowser</span><span class="pln">.close Example</span><span class="tag"/><span class="pln">
    
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"cordova.js"</span><span class="tag">></script></span><span class="pln">
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="tag">></span><span class="pln">
    
        </span><span class="com">// Wait for device API libraries to load</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">"</span><span class="str">deviceready</span><span class="str">"</span><span class="pun">,</span><span class="pln"> onDeviceReady</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
    
        </span><span class="com">// device APIs are available</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> onDeviceReady</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             </span><span class="kwd">var</span><span class="pln"> ref </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
             </span><span class="com">// close </span><span class="com">InAppBrowser</span><span class="com"> after 5 seconds</span><span class="pln">
             setTimeout</span><span class="pun">(</span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                 ref</span><span class="pun">.</span><span class="pln">close</span><span class="pun">();</span><span class="pln">
             </span><span class="pun">},</span><span class="pln"> </span><span class="lit">5000</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="tag"></script></span><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
    </span><span class="tag"/><span class="pln">
    </span></span></code></pre> 
      <h1>  </h1> 
      <blockquote> 
       <p>         InAppBrowser   。         ,   InAppBrowser      。</p> 
      </blockquote> 
      <pre><code><span class="kwd">ref</span><span class="pun">.</span><span class="pln">show</span><span class="pun">();</span><span class="pln">
    </span></code></pre> 
      <ul> 
       <li><strong>ref:</strong>  InAppBrowser    (  <code>InAppBrowser</code>)</li> 
      </ul> 
      <h2>     </h2> 
      <ul> 
       <li>Android   </li> 
       <li>    </li> 
       <li>iOS</li> 
      </ul> 
      <h2>     </h2> 
      <pre><code><span class="kwd">var</span><span class="pln"> </span><span class="kwd">ref</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'hidden=yes'</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">show</span><span class="pun">();</span><span class="pln">
    </span></code></pre> 
      <h2>     </h2> 
      <pre><code><span class="dec"><span class="pln">
    </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
        </span><span class="tag"><title/></span><span class="pln">InAppBrowser</span><span class="pln">.show Example</span><span class="tag"/><span class="pln">
    
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"cordova.js"</span><span class="tag">></script></span><span class="pln">
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="tag">></span><span class="pln">
    
        </span><span class="com">// Wait for Cordova to load</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">"</span><span class="str">deviceready</span><span class="str">"</span><span class="pun">,</span><span class="pln"> onDeviceReady</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
    
        </span><span class="com">// Cordova is ready</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> onDeviceReady</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             </span><span class="kwd">var</span><span class="pln"> ref </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'hidden=yes'</span><span class="pun">);</span><span class="pln">
             ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                 alert</span><span class="pun">(</span><span class="str">'background window loaded'</span><span class="pun">);</span><span class="pln"> 
             </span><span class="pun">});</span><span class="pln">
             </span><span class="com">// close </span><span class="com">InAppBrowser</span><span class="com"> after 5 seconds</span><span class="pln">
             setTimeout</span><span class="pun">(</span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                 ref</span><span class="pun">.</span><span class="pln">close</span><span class="pun">();</span><span class="pln">
             </span><span class="pun">},</span><span class="pln"> </span><span class="lit">5000</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="tag"></script></span><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
    </span><span class="tag"/><span class="pln">
    </span></span></code></pre> 
      <h1>executeScript</h1> 
      <blockquote> 
       <p>    JavaScript    <code>InAppBrowser</code>   </p> 
      </blockquote> 
      <pre><code><span class="kwd">ref</span><span class="pun">.</span><span class="pln">executeScript</span><span class="pln"> </span><span class="pun"> </span><span class="pun"> </span><span class="pun">     )</span><span class="pln"> </span><span class="pun">;</span><span class="pln">
    </span></code></pre> 
      <ul> 
       <li> <p><strong>ref</strong>:    <code>InAppBrowser</code>   。<em>() InAppBrowser</em></p> </li> 
       <li> <p><strong>injectDetails</strong>:                <code>file</code>   <code>code</code>    。<em>(  )</em></p> 
        <ul> 
         <li><strong> </strong>:     URL    。</li> 
         <li><strong>  </strong>:         。</li> 
        </ul></li> 
       <li> <p><strong>  </strong>:        JavaScript      。</p> 
        <ul> 
         <li>           <code>code</code> ,          ,         ,   <code>Array</code> 。       ,                     。</li> 
        </ul></li> 
      </ul> 
      <h2>     </h2> 
      <ul> 
       <li>Android   </li> 
       <li>    </li> 
       <li>iOS</li> 
      </ul> 
      <h2>     </h2> 
      <pre><code><span class="kwd">var</span><span class="pln"> </span><span class="kwd">ref</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
        </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">executeSript</span><span class="pun">({</span><span class="pln">file</span><span class="pun">:</span><span class="pln"> </span><span class="str">"myscript.js"</span><span class="pun">});</span><span class="pln">
    </span><span class="pun">});</span><span class="pln">
    </span></code></pre> 
      <h2>     </h2> 
      <pre><code><span class="dec"><span class="pln">
    </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
        </span><span class="tag"><title/></span><span class="pln">InAppBrowser</span><span class="pln">.</span><span class="pln">executeScript</span><span class="pln"> Example</span><span class="tag"/><span class="pln">
    
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"cordova.js"</span><span class="tag">></script></span><span class="pln">
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="tag">></span><span class="pln">
    
        </span><span class="com">// Wait for device API libraries to load</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">"</span><span class="str">deviceready</span><span class="str">"</span><span class="pun">,</span><span class="pln"> onDeviceReady</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
    
        </span><span class="com">// Global </span><span class="com">InAppBrowser</span><span class="com"> reference</span><span class="pln">
        </span><span class="kwd">var</span><span class="pln"> iabRef </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
    
        </span><span class="com">// Inject our custom JavaScript into the </span><span class="com">InAppBrowser</span><span class="com"> window</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> replaceHeaderImage</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            iabRef</span><span class="pun">.</span><span class="pln">executeScript</span><span class="pun">({</span><span class="pln">
                code</span><span class="pun">:</span><span class="pln"> </span><span class="str">"var img=document.querySelector('#header img'); img.src='http://cordova.apache.org/images/cordova_bot.png';"</span><span class="pln">
            </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                alert</span><span class="pun">(</span><span class="str">"Image Element Successfully Hijacked"</span><span class="pun">);</span><span class="pln">
            </span><span class="pun">}</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="kwd">function</span><span class="pln"> iabClose</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> replaceHeaderImage</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'exit'</span><span class="pun">,</span><span class="pln"> iabClose</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="com">// device APIs are available</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> onDeviceReady</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             iabRef </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> replaceHeaderImage</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'exit'</span><span class="pun">,</span><span class="pln"> iabClose</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="tag"></script></span><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
    </span><span class="tag"/><span class="pln">
    </span></span></code></pre> 
      <h1>insertCSS</h1> 
      <blockquote> 
       <p>    CSS <code>InAppBrowser</code>   。</p> 
      </blockquote> 
      <pre><code><span class="kwd">ref</span><span class="pun">.</span><span class="pln">insertCSS</span><span class="pun">(</span><span class="pln">details</span><span class="pun">,</span><span class="pln"> callback</span><span class="pun">);</span><span class="pln">
    </span></code></pre> 
      <ul> 
       <li> <p><strong>ref</strong>:    <code>InAppBrowser</code>   <em>(InAppBrowser)</em></p> </li> 
       <li> <p><strong>injectDetails</strong>:                <code>file</code>   <code>code</code>    。<em>(  )</em></p> 
        <ul> 
         <li><strong> </strong>:      URL    。</li> 
         <li><strong>  </strong>:         。</li> 
        </ul></li> 
       <li> <p><strong>  </strong>:   CSS         。</p> </li> 
      </ul> 
      <h2>     </h2> 
      <ul> 
       <li>Android   </li> 
       <li>    </li> 
       <li>iOS</li> 
      </ul> 
      <h2>     </h2> 
      <pre><code><span class="kwd">var</span><span class="pln"> </span><span class="kwd">ref</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
        </span><span class="kwd">ref</span><span class="pun">.</span><span class="pln">insertCSS</span><span class="pun">({</span><span class="pln">file</span><span class="pun">:</span><span class="pln"> </span><span class="str">"mystyles.css"</span><span class="pun">});</span><span class="pln">
    </span><span class="pun">});</span><span class="pln">
    </span></code></pre> 
      <h2>     </h2> 
      <pre><code><span class="dec"><span class="pln">
    </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
        </span><span class="tag"><title/></span><span class="pln">InAppBrowser</span><span class="pln">.</span><span class="pln">insertCSS</span><span class="pln"> Example</span><span class="tag"/><span class="pln">
    
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"cordova.js"</span><span class="tag">></script></span><span class="pln">
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="tag">></span><span class="pln">
    
        </span><span class="com">// Wait for device API libraries to load</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">"</span><span class="str">deviceready</span><span class="str">"</span><span class="pun">,</span><span class="pln"> onDeviceReady</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
    
        </span><span class="com">// Global </span><span class="com">InAppBrowser</span><span class="com"> reference</span><span class="pln">
        </span><span class="kwd">var</span><span class="pln"> iabRef </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
    
        </span><span class="com">// Inject our custom CSS into the </span><span class="com">InAppBrowser</span><span class="com"> window</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> changeBackgroundColor</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            iabRef</span><span class="pun">.</span><span class="pln">insertCSS</span><span class="pun">({</span><span class="pln">
                code</span><span class="pun">:</span><span class="pln"> </span><span class="str">"body { background: #ffff00"</span><span class="pln">
            </span><span class="pun">},</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
                alert</span><span class="pun">(</span><span class="str">"Styles Altered"</span><span class="pun">);</span><span class="pln">
            </span><span class="pun">}</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="kwd">function</span><span class="pln"> iabClose</span><span class="pun">(</span><span class="pln">event</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> changeBackgroundColor</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">removeEventListener</span><span class="pun">(</span><span class="str">'exit'</span><span class="pun">,</span><span class="pln"> iabClose</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="com">// device APIs are available</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> onDeviceReady</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
             iabRef </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'loadstop'</span><span class="pun">,</span><span class="pln"> changeBackgroundColor</span><span class="pun">);</span><span class="pln">
             iabRef</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">'exit'</span><span class="pun">,</span><span class="pln"> iabClose</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="tag"></script></span><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
    </span><span class="tag"/><span class="pln">
    </span></span></code></pre> 
      <h1>InAppBrowserEvent</h1> 
      <p>           <code>addEventListener</code>     <code>InAppBrowser</code>    。</p> 
      <h2>  </h2> 
      <ul> 
       <li> <p><strong>  </strong>: eventname,   <code>loadstart</code> , <code>loadstop</code> , <code>loaderror</code> ,  <code>exit</code> 。<em>(  )</em></p> </li> 
       <li> <p><strong>url</strong>:      URL。<em>(  )</em></p> </li> 
       <li> <p><strong>  </strong>:            <code>loaderror</code> 。<em>(  )</em></p> </li> 
       <li> <p><strong>  </strong>:      ,        <code>loaderror</code> 。<em>(  )</em></p> </li> 
      </ul> 
      <h1>window.open</h1> 
      <p>         URL <code>InAppBrowser</code>   ,              。</p> 
      <pre><code><span class="kwd">var</span><span class="pln"> </span><span class="kwd">ref</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="pln">url</span><span class="pun">,</span><span class="pln"> target</span><span class="pun">,</span><span class="pln"> options</span><span class="pun">);</span><span class="pln">
    </span></code></pre> 
      <ul> 
       <li> <p><strong>ref</strong>:    <code>InAppBrowser</code>   。<em>() InAppBrowser</em></p> </li> 
       <li> <p><strong>url</strong>:    <em>(  )</em>  URL。   <code>encodeURI()</code>      URL    Unicode   。</p> </li> 
       <li> <p><strong>  </strong>:          URL,    ,     <code>_self</code> 。<em>(  )</em></p> 
        <ul> 
         <li><code>_self</code>:         web      URL       ,      <code>InAppBrowser</code>.</li> 
         <li><code>_blank</code>:    <code>InAppBrowser</code>.</li> 
         <li><code>_system</code>:       web       。</li> 
        </ul></li> 
       <li> <p><strong>  </strong>:     <code>InAppBrowser</code> 。  ,   : <code>location=yes</code> 。<em>(  )</em></p> <p><code>options</code>              ,               /  。          。            :</p> 
        <ul> 
         <li> <p><strong>  </strong>:     <code>yes</code>   <code>no</code> ,   <code>InAppBrowser</code>          。</p> <h2>Android  </h2> </li> 
         <li> <p><strong>closebuttoncaption</strong> -        ,    "  "     。 </p> </li> 
         <li><strong>  </strong>-               ,      。 Load           。         (   ),       ,         。 </li> 
         <li><strong>clearcache</strong> -    'yes'       cookie            </li> 
         <li> <p><strong>clearsessioncache</strong> -    'yes'     cookie            </p> <h2>iOS  </h2> </li> 
         <li> <p><strong>closebuttoncaption</strong> -        ,    "  "     。               。</p> </li> 
         <li><strong>  </strong>-               ,      。 Load           。         (   ),       ,         。 </li> 
         <li><strong>   </strong>-    ' '   ' ',          InAppBrowser (     )</li> 
         <li><strong>enableViewportScale</strong>:      <code>yes</code>   <code>no</code> ,     meta    (        <code>no</code>).</li> 
         <li><strong>mediaPlaybackRequiresUserAction</strong>:      <code>yes</code>   <code> no</code> ,   HTML5        autoplaying (   <code>no</code>).</li> 
         <li><strong>allowInlineMediaPlayback</strong>:      <code>yes</code>   <code>no</code>      HTML5     ,       ,               。 HTML   <code>video</code>         <code>webkit-playsinline</code>    (   <code>no</code>)</li> 
         <li><strong>keyboardDisplayRequiresUserAction</strong>:      <code>yes</code>   <code> no</code>  ,                JavaScript   <code>focus()</code>    (   <code>yes</code>).</li> 
         <li><strong>suppressesIncrementalRendering</strong>:      <code>yes</code>   <code> no</code>   ,               (      <code>no</code>).</li> 
         <li><strong>presentationstyle</strong>:      <code>pagesheet</code> , <code>formsheet</code>   <code>fullscreen</code>          (   <code>fullscreen</code>).</li> 
         <li><strong>transitionstyle</strong>:      <code>fliphorizontal</code> , <code>crossdissolve</code>   <code>coververtical</code>       (   <code>coververtical</code>).</li> 
        </ul></li> 
      </ul> 
      <h2>     </h2> 
      <ul> 
       <li>Android   </li> 
       <li>    </li> 
       <li>iOS</li> 
       <li>Windows Phone 7   8</li> 
      </ul> 
      <h2>     </h2> 
      <pre><code><span class="kwd">var</span><span class="pln"> </span><span class="kwd">ref</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">var</span><span class="pln"> ref2 </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="pln">encodeURI</span><span class="pun">(</span><span class="str">'http://ja.m.wikipedia.org/wiki/ハングル'</span><span class="pun">),</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
    </span></code></pre> 
      <h2>     </h2> 
      <pre><code><span class="dec"><span class="pln">
    </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
        </span><span class="tag"><title/></span><span class="pln">window.open</span><span class="pln"> Example</span><span class="tag"/><span class="pln">
    
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="pln"> </span><span class="atn">src</span><span class="pun">=</span><span class="atv">"cordova.js"</span><span class="tag">></script></span><span class="pln">
        </span><span class="tag"><script><span class="pln"> </span><span class="atn">type</span><span class="pun">=</span><span class="atv">"text/javascript"</span><span class="pln"> </span><span class="atn">charset</span><span class="pun">=</span><span class="atv">"utf-8"</span><span class="tag">></span><span class="pln">
    
        </span><span class="com">// Wait for device API libraries to load</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        document</span><span class="pun">.</span><span class="pln">addEventListener</span><span class="pun">(</span><span class="str">"</span><span class="str">deviceready</span><span class="str">"</span><span class="pun">,</span><span class="pln"> onDeviceReady</span><span class="pun">,</span><span class="pln"> </span><span class="kwd">false</span><span class="pun">);</span><span class="pln">
    
        </span><span class="com">// device APIs are available</span><span class="pln">
        </span><span class="com">//</span><span class="pln">
        </span><span class="kwd">function</span><span class="pln"> onDeviceReady</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            </span><span class="com">// external url</span><span class="pln">
            </span><span class="kwd">var</span><span class="pln"> ref </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="pln">encodeURI</span><span class="pun">(</span><span class="str">'http://apache.org'</span><span class="pun">),</span><span class="pln"> </span><span class="str">'_blank'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'location=yes'</span><span class="pun">);</span><span class="pln">
            </span><span class="com">// relative document</span><span class="pln">
            ref </span><span class="pun">=</span><span class="pln"> </span><span class="pln">window</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="str">'next.html'</span><span class="pun">,</span><span class="pln"> </span><span class="str">'_self'</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    
        </span><span class="tag"></script></span><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
      </span><span class="tag"/><span class="pln">
    </span><span class="tag"/><span class="pln">
    </span></span></code></pre> 
     </div> 
    </div>
                                </div>
                            </div>

    좋은 웹페이지 즐겨찾기