I have a problem about changing website title during two process.
When I enter webpage, its title has changed via the code shown below.
<script type="text/javascript">
$(document).ready(function() {
document.title = 'New Title';
});
</script>
The sceranio,
- There are two blank page in my browser. a.html and b.html
- My website is a.html and its title "A page"
- When I enter to the a.html, its name changed as New title
- When I click to the b.html page, I want to change title of a.html as "A Page"
When I am at the any blank page in browser, I want to change its title again. How can I do it?
I found a code snippet about it . Is it right?
<script>
window.onblur = function () { document.title = 'A Page?'; }
window.onfocus = function () { document.title = 'New Title'; }
</script>