前端开发2025年09月27日
题目没说清 具体需求是 页面上需要增加一个下载图片的功能。后台这个时候可以给我一个图片的src,但众所周知,链接到图片的src后只会在新页面打开图片,而不会弹出下载提示,让用户去下载图片。 我本以为,js是做不到这样的功能的,还是自己的知识面过窄了,请教了我们这边的技术牛后,果真得到了我想要的答案。 可惜的是,PM觉得这个需求有些不够尽善,在我刚准备埋代码...
前端开发2025年09月27日
什么是跨域 1、document.domain+iframe的设置 2、动态创建script 3、利用iframe和location.hash 4、window.name实现的跨域数据传输 5、使用HTML5 postMessage 6、利用flash 本文来自网络(http://f2e.me/200904/cross-scripting/,该网址已不能访...
前端开发2025年09月26日
<script> $(function () { var d = new Date(); var strDate = getDateStr(d); $("#beginTime").val(strDate); $("#endTime").val(strDate); //$("#beginTime").val("2015-10-10"); $("#...
前端开发2025年09月26日
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></...
前端开发2025年09月26日
转自http://blog.csdn.net/fightplane/article/details/5190037 <a href="#"> 点击链接后,页面会向上滚到页首,# 默认锚点为 #TOP <a href="javascript:void(0)" onClick="window.open()"> 点击链接后,页面不动,只打...
前端开发2025年09月26日
function countBodyChildren(){ var body_element = document.getElementsByTagName("body")[0]; alert(body_element.childNodes.length); } window.onload = countBodyChildren; //...
前端开发2025年09月25日
Wiggle Sort II Given an unsorted array nums, reorder it such that nums[0] &lt; nums[1] &gt; nums[2] &lt; nums[3].... Example:(1) Given nums = [1, 5, 1, 1, 6, 4], one p...
前端开发2025年09月25日
js中免不了的要用的数组,一维的二维的三维的 但是当用到thymeleaf作为模版时候会有一些坑,导致数组不能用 org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: " {checkbox: true, fixed: true} ...
前端开发2025年09月25日
/*汉字拼音的数据字典-共396个-通过组合声母和韵母*/ var PinYin = {"a":"\u554a\u963f\u9515","ai":"\u57c3\u6328\u54ce\u5509\u54c0\u7691\u764c\u853c\u77ee\u827e\u788d\u7231\u9698\u8bf6\u6371\u55f3\u55cc\u...
前端开发2025年09月25日
程序中设置两个线程:一个负责程序本身的运行,称为"主线程";另一个负责主线程与其他进程(主要是各种I/O操作)的通信,被称为"Event Loop线程"(可以译为"消息线程")。 所有任务可以分成两种,一种是同步任务(synchronous),另一种是异步任务(asynchronous)。同步任务指的是,在主线程上排队执行的任务,只有前一个任务执行完毕,才...