When using the Google UI, open a hyperlink on the current page. The page will be refreshed locally as needed, instead of replacing the entire page. When you select a new window to open a hyperlink, the hyperlink can still reach the expected page.
<Html>
<Head>
<Meta http-equiv = "content-type" content = "text/html; charset = UTF-8">
<Title> A Click Event Test </title>
<Script type = "text/javascript" src = "jquery. min. js"> </script>
<Script type = "text/javascript">
$ (Function (){
/* Click events will occur before the hyperlink jump */
$ ("# Div_test a"). click (function (){
Var link = $ (this). attr ('href ');
$ ('# Div_view'). attr ('src', link );
Var href = window. location. href;
Window. location. href = href. substr (0, href. indexOf ('#') + '#' + link;
Return false;
});
});
</Script>
</Head>
<Body>
<Div id = "div_test">
<Ol>
<Li> <a href = "http://xiaoxia.org"> xiaoxia </a> </li>
<Li> <a href = "http://www.ibaiyang.org"> ibaiyang </a> </li>
<Li> <a href = "http://www.xiaoxins.com"> xiaoxins.com </a> </li>
</Ol>
</Div>
<Iframe id = "div_view" width = "100%"> </iframe>
</Body>
</Html>
This is just a test I performed with jQuery and I don't know how Google implements it. For example, after clicking a hyperlink event, the page uses iframe to perform partial refresh. At this time, the browser's address bar should change. How can this be changed?
Currently, I modify window. location to change the address, but I can only change the content after # symbol. If the previous content changes, the browser may refresh the entire page?
From Xiaoxia