加载中
用JavaScript编码URL? - Encode URL in JavaScript?

问题: How do you safely encode a URL using JavaScript such that it can be put into a GET string? 如何使用JavaScript安全地编码URL,以便可以将其放入GET字符串中? var myUrl = "htt...

2020/08/01 18:53
96
您如何获得JavaScript时间戳? - How do you get a timestamp in JavaScript?

问题: How can I get a timestamp in JavaScript? 如何获取JavaScript时间戳? Something similar to Unix timestamp , that is, a single number that represents the current time and da...

2020/07/29 23:20
93
JavaScript .prototype如何工作? - How does JavaScript .prototype work?

问题: I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. 我不喜欢动态编程语言,但是我写了相当一部分JavaScript代码。 I never real...

2020/03/29 05:47
48
遍历JavaScript中的数组 - Loop through an array in JavaScript

问题: In Java you can use a for loop to traverse objects in an array as follows: 在Java中,可以使用for循环遍历数组中的对象,如下所示: String[] myStringArray = {"Hello", "Worl...

2020/07/31 02:52
31
为JavaScript日期添加天数 - Add days to JavaScript Date

问题: How to add days to current Date using JavaScript. 如何使用JavaScript将天添加到当前Date 。 Does JavaScript have a built in function like .Net's AddDay ? JavaScript是否具有...

函数名称前的JavaScript加号 - JavaScript plus sign in front of function name

问题: I've been looking on info about self-invoking functions, and somewhere I stumbled on this notation: 我一直在寻找有关自调用函数的信息,在某个地方我偶然发现了这种表示法: ...

2020/06/25 09:35
39
使用JavaScript获取当前URL? - Get the current URL with JavaScript?

问题: All I want is to get the website URL. 我想要的只是获取网站URL。 Not the URL as taken from a link. 不是从链接获取的URL。 On the page loading I need to be able to grab the ...

2020/07/31 08:52
55
如何使用JavaScript复制到剪贴板? - How do I copy to the clipboard in JavaScript?

问题: What is the best way to copy text to the clipboard? 将文本复制到剪贴板的最佳方法是什么? (multi-browser) (多浏览器) I have tried: 我试过了: function copyToClipboard(t...

2020/03/25 06:13
496
使用JavaScript滚动到页面顶部吗? - Scroll to the top of the page using JavaScript?

问题: How do I scroll to the top of the page using a JavaScript? 如何使用JavaScript滚动到页面顶部? It is desirable even if the scrollbar instantly jumps to the top. 即使滚动条...

如何正确克隆JavaScript对象? - How do I correctly clone a JavaScript object?

问题: I have an object, x . 我有一个对象x 。 I'd like to copy it as object y , such that changes to y do not modify x . 我想将其复制为对象y ,以使对y更改不会修改x 。 I realized...

2020/05/30 17:30
48
在JavaScript中将字符串转换为日期 - Converting a string to a date in JavaScript

问题: How can I convert a string to a date in JavaScript? 如何在JavaScript中将字符串转换为日期? var st = "date in some format" var dt = new date(); var dt_st= //st in date fo...

2020/07/17 06:35
278
JavaScript等同于printf / String.Format - JavaScript equivalent to printf/String.Format

问题: I'm looking for a good JavaScript equivalent of the C/PHP printf() or for C#/Java programmers, String.Format() ( IFormatProvider for .NET). 我正在寻找一个等效于C / PHP p...

使用JavaScript滚动到页面顶部吗? - Scroll to the top of the page using JavaScript?

问题: How do I scroll to the top of the page using a JavaScript? 如何使用JavaScript滚动到页面顶部? It is desirable even if the scrollbar instantly jumps to the top. 即使滚动条...

2020/04/02 21:53
39
在JavaScript中创建GUID / UUID? - Create GUID / UUID in JavaScript?

问题: I'm trying to create globally-unique identifiers in JavaScript. 我正在尝试在JavaScript中创建全局唯一标识符。 I'm not sure what routines are available on all browsers, ho...

2020/05/29 09:59
45
如何在JavaScript中获取当前日期? - How do I get the current date in JavaScript?

问题: 如何在JavaScript中获取当前日期? 解决方案: 参考一:https://stackoom.com/question/6QJ3/如何在JavaScript中获取当前日期 参考二:https://oldbug.net/q/6QJ3/How-do-I-get-the-...

2020/08/02 20:55
35
JavaScript窗口调整大小事件 - JavaScript window resize event

问题: How can I hook into a browser window resize event? 如何挂钩浏览器窗口调整大小事件? There's a jQuery way of listening for resize events but I would prefer not to bring it...

2020/07/18 01:06
134
JavaScript中的“ new”关键字是什么? - What is the 'new' keyword in JavaScript?

问题: The new keyword in JavaScript can be quite confusing when it is first encountered, as people tend to think that JavaScript is not an object-oriented programming language....

2020/03/31 21:20
100
从Javascript数组中删除空元素 - Remove empty elements from an array in Javascript

问题: How do I remove empty elements from an array in JavaScript? 如何从JavaScript中的数组中删除空元素? Is there a straightforward way, or do I need to loop through it and re...

2020/06/18 07:54
456
页面加载后如何使JavaScript执行? - How to make JavaScript execute after page load?

问题: I'm executing an external script, using a <script> inside <head> . 我正在使用<head>内的<script>执行外部脚本。 Now since the script executes before the page has loaded, I ...

2020/05/04 21:31
37
检查变量是否为JavaScript中的字符串 - Check if a variable is a string in JavaScript

问题: 如何确定变量是字符串还是JavaScript中的其他内容? 解决方案: 参考一:https://stackoom.com/question/H1y7/检查变量是否为JavaScript中的字符串 参考二:https://oldbug.net/q/H1...

2020/08/07 20:03
55

没有更多内容

加载失败,请刷新页面

返回顶部
顶部