• JavaScript 小经验


    1、使用window.location.replace,而非window.location.href,浏览器将不会记录当前浏览历史;

    2、关于渐进增强:1)使用noscript标签;2)document.write("<!--");//code...document.write("-->");

    3、点击checkbox文件将选中勾选框:<input type="checkbox" id="cb1" /><label for="cb1">文字</label> ;

    4、利用ajax来post信息,后台取不到数据,原因为没有设置Content-Type,后端程式无法将数据解析成key-value格式:

         xhr.open("POST",url,true);

         xhr.setRequestHeader("Content-Type", "application/x-www-urlencoded");

         xhr.send($.param({"user":$("#user").val(), "pwd":$("#pwd").val()}));

    5、后端程式需要将【user输入内容】encoding后再输出页面,防止【user输入内容】为javascript可执行文本

  • 相关阅读:
    【转】双口RAM
    Beep使用
    fcntl函数
    ioctl() 参数
    线程属性:pthread_attr_t
    GPIO
    Linux CGI编程基础
    看门狗watchdog
    Linux库知识大全
    linux进程间通讯
  • 原文地址:https://www.cnblogs.com/null2/p/3543553.html
Copyright © 2020-2023  润新知