script03.js

来自「图灵程序设计丛书 JavaScript基础教程源代码」· JavaScript 代码 · 共 33 行

JS
33
字号
var framesetPage = "frameset3.html";var currPage = justTheFilename(self.location.pathname);if (top.location == self.location && framesetPage != currPage) {	self.location.replace(framesetPage + "?" + currPage);}window.onload = chgFrame;function chgFrame() {	if (top.location == self.location && document.location.search) {		var linkURL = justTheFilename(document.location.search);		var contentWin = document.getElementById("content").contentWindow;		var currURL = justTheFilename(contentWin.location.pathname);		if (currURL != linkURL) {			contentWin.location.replace(linkURL);		}	}}function justTheFilename(thisFile) {	if (thisFile.indexOf("/") > -1) {		thisFile = thisFile.substring(thisFile.lastIndexOf("/")+1);	}	if (thisFile.indexOf("?") == 0) {		thisFile = thisFile.substring(1);	}	return thisFile;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?