美文网首页全栈(一)
跳转的源页面、获取地址栏参数、Math、新增选择器

跳转的源页面、获取地址栏参数、Math、新增选择器

作者: Agony_锐 | 来源:发表于2019-12-31 14:21 被阅读0次

跳转的源页面:

document.referrer    ——    获取上一个跳转页面的地址(需要服务器环境)

获取地址栏参数:

window.location.href     ——    获取或者重定url地址

window.location.search     ——    获取地址参数部分

window.location.hash     ——    获取页面锚点或者叫哈希值

Math:

Math.random     ——    获取0-1的随机数

Math.floor    ——     向下取整

Math.ceil     ——    向上取整

新增选择器:

相关文章

网友评论

    本文标题:跳转的源页面、获取地址栏参数、Math、新增选择器

    本文链接:https://www.haomeiwen.com/subject/whbboctx.html