GWT back button browser

后端 未结 5 823
长情又很酷
长情又很酷 2021-01-18 11:08

For example current page is www.google.com. But I typed a different website address in address bar and clicked. This site has fully GWT code.

But I like to back to t

5条回答
  •  悲&欢浪女
    2021-01-18 12:00

    you also can use this native code

     public native void call()/*-{
    
        $wnd.onkeydown = GetChar;
    
         function GetChar (event)
         {
            var key = event.keyCode;
    
            var bb = event.target.nodeName;
    
            if(key==8 && bb=="BODY")//checking keyCode of key for backspace
                    {
                        var x= window.confirm("Are you sureyou want to leave the page");
    
                        if (x==true)
                                {
                                    window.history.back();
                                }
                        else if(x==false)
                                {
    
                                    return false;
                                }
                    }
            }                   
    }-*/;
    

提交回复
热议问题