Comments (8)
效果页面加载并不在index中,而在不同的子页面加载
例如:nyancat.html
这个页面中包含两个js,include.js创建一个iframe元素,nyancat.js则是实际的效果
include.js会监听url锚点的变化,来改变iframe的引用,例如
http://nyan.takwolf.com/nyancat#http://blog.takwolf.com
"#"后面部分可以替换为目标页面
index.html仅仅用来做跳转
from nyancateverywhere.
你可以忽略掉index.html这个文件,只关注nyancat.html即可
from nyancateverywhere.
感谢指点,还有疑问的是在index.html没发现引入include.js那它是怎么监听到锚点的变化?window.open这个函数怎么跳转到nyancat.html的?
from nyancateverywhere.
window.open这个函数是打开一个新页面
include.js是在nyancat.html中引入的,因此锚点是在nyancat.html中监听的,而不是在index.html中
from nyancateverywhere.
抱歉,我的意思是window.open是怎么跳到nyancat.html中的?
from nyancateverywhere.
button点击的时候会调用go这个函数,会传递一个对应的id进去,然后通过id获取对应input中的url,手动拼接了一下。window.open(url)是一个系统函数,作用是打开一个新页面
from nyancateverywhere.
十分感谢,我看漏了,原来http://nyan.takwolf.com/nyancat这个地址就表示访问了nyancat.html
from nyancateverywhere.
喵~
from nyancateverywhere.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nyancateverywhere.