• 打卡web基础学习


    6.26-6.27HTML

    最简单的格式

    1. <html>
    2. <head>
    3. <title>菜鸡</title>
    4. <body>
    5. <h1></h1>
    6. <h2></h2>
    7. </body>
    8. </html>

    h后面的数字越小字体越大 

    JavaScript

    位于script标签中间

    1、var定义变量

    感觉写法跟python差不多,输出不同

    2、标识符

    javascript对大小写敏感,目前见到的好像就sql对大小写不敏感

    3、赋值运算符

    =是赋值,==是等于

    4、DOM操作

     (1)获取HTML元素:getElementById()

    1. <html>
    2. <head>
    3. <title>
    4. 中国
    5. </title>
    6. </head>
    7. <body>
    8. <p id="taiwan">台湾是中国领土主权不可分割的一部分</p>
    9. <script>x=document.getElementById("taiwan")</script>
    10. </body>
    11. </html>

    (2)获取HTML元素内容:innerHTML()

    1. <html>
    2. <head>
    3. <title>
    4. 中国
    5. </title>
    6. </head>
    7. <body>
    8. <p id="taiwan">台湾是中国领土主权不可分割的一部分</p>
    9. <script>
    10. x=document.getElementById("taiwan");
    11. alert('id为taiwan元素的内容是:'+x.innerHTML);
    12. </script>
    13. </body>
    14. </html>

    (3)添加动态效果

    document.write() 写入 HTML 输出,会清除已有html
    console.log() 写入浏览器控制台

    document.write(Date())写入时间

     

    document.write("<iframe src='http://www.heetian.com'></iframe>");写入框架

     onclick事件属性

    1. <html>
    2. <head>
    3. <title>
    4. 菜鸡本鸡
    5. </title>
    6. </head>
    7. <body>
    8. <p id="taiwan"><h1>菜鸡</h1></p>
    9. <script>
    10. function ti(id)
    11. {
    12. id.innerHTML="是你";
    13. }
    14. </script>
    15. <h2 onclick="ti(this)">点击这里</h2>
    16. </body>
    17. </html>

    5、BOM操作

    alert()警告弹窗

    confirm() 确定弹窗

    prompt()提示弹窗 

    document.cookie获取cookie信息

    window:客户端JavaScript中的顶层对象。每当<body>或<frameset>标签出现时,window对象就会被自动创建
    navigator:包含客户端有关浏览器的信息
    screen:包含客户端显示屏的信息
    history:包含浏览器窗口访问过的URL信息
    location:包含当前网页文档的URL信息
    document:包含整个HTML文档,可被用来访问文档内容,及其所有页面元素

    HTTP协议

    http://www.runoob.com/http/http-tutorial.html

    web服务端架构

  • 相关阅读:
    一份小盒饭的“深圳创新密码”
    前端样式获取
    CSS 计数器之 counter()
    Python快速刷题网站——牛客网 数据分析篇(六)
    echarts文档解读
    软件工程与计算总结(二十二)软件开发过程模型
    我屮艸芔茻,mongo居然可以自动删除数据
    【SQLite】三、SQLite 的常用语法
    2023最新版Android逆向教程——第4天:真机环境的配置
    Swagger未授权访问漏洞
  • 原文地址:https://blog.csdn.net/wow0524/article/details/125456914