用参数打开工作簿(Open workbook with arguments)
Question : Is there a way to open a workbook and pass an argument/parameter through this action ?
The idea is to differentiate the case where a user directly open Workbook B (which will trigger its Auto_Open code) and the case where Workbook B is opened from the code of an other Workbook.
原文:
最满意答案
通过使用!,它正在评估匿名函数(从而要求它运行)。 没有它,你会得到一个错误。
并且,正如其他人所说,如果您正在分配或评估它,它将反转函数返回的结果。
By using !, it's evaluating the anonymous function (thereby requiring it to run). Without that, you'd get an error.
And, as others have said, it will invert the result of whatever the function returns, if you're assigning it or evaluating it.
相关问答
更多-
Javascript - 如何调用自调用函数中的方法?(Javascript - How to invoke a method inside self invoking function?)[2022-11-16]
不要给自调用函数一个名称(除了在堆栈跟踪中更容易找到它之外没有什么好处,你不应该在那时找到它,并且旧IE中的内存泄漏) 不要两次调用自调用函数 不要将自调用函数视为构造函数(通过使用new调用它) 捕获自调用函数的返回值 这样: var x = (function () { var j = function() { alert("234234"); }; return { s: j }; })(); ... -
您不能在表达式中声明var ,但可以将其定义放在一个中: var ShowMe; (ShowMe = function() { if ($('input:checkbox:checked').length) { $('#Save').fadeIn('slow'); } else { $('#Save').hide(); } })(); $('input:checkbox').on('click',ShowMe); You can't declare ...
-
如果将两个文件与自调用函数连接在一起,如下所示: 文件A: (function(){...A...})() 文件B: (function(){...B...})() 文件A + B: (function(){...A...})()(function(){...B...})() 你有两个没有分隔符的语句。 当您将猫文件放在一起,然后将其缩小时,会发生这种情况 现在文件B的作者把一个分号放在前面: 文件B2: ;(function(){...B2...})() 你会得到一个工作脚本: (function ...
-
这可能是因为您拖动它并重新创建元素节点。 你可以使用Event来解决问题。 $(document).ready(function(){ // It delegate thumb-img event to body, so whatever you recreate thumb-img,is all right $('body').on('click', '.thumb-img', function(){ var url = $(this).attr('src'); $(this).c ...
-
“自我调用函数”实际上并不是JavaScript的一部分,它只是一个术语,人们正在调用特定的代码模式(如AJAX等)。 这些模式应该在javascript工作的任何地方工作。 你所说的“自我调用函数”只是创建一个匿名函数并立即调用它(而不是将其存储在var中,作为对象值,作为函数参数等)。 也就是说,以下基本相同: var f = function(){...}; f() 和 ( function(){...} )() 所以,因为你的'自我调用函数'是javascript的一个基本部分,除非内部不工作或 ...
-
Javascript自调用功能无法在角度离子中工作(Javascript self invoking function not working in angular ionic)[2022-03-20]
很可能你的一个js声明缺少';' 最后。 尝试添加';' 在你的自我调用功能之前 。 在这里阅读更多 我们最终将第二个函数作为参数传递给第一个函数,然后尝试将第一个函数调用的结果作为函数调用。 第二个函数将在运行时因“...不是函数”错误而失败。 Most probably one of your js statement is missing a ';' at the end. Try add a ';' before your self invoking function. Read more here ... -
不,并不是所有的代码都会被执行。 当你定义你的Angular模块 (function() { 'use strict'; angular .module('myModule', []) .controller('myController', ['$http', myControllerFunc]); function myControllerFunc ($http) { // ... } })(); 执行什么只是注册模块和控制器的angular方法。 但实际的控 ...
-
这很奇怪,因为定义构造函数的目的是能够重用它来创建许多对象。 为了您的目的,您可以使用此构造 - myNamespace.HelpModule = (function(){ //private stuff here var a = 100; return { //public stuff here b : 200, something: function() { return a + this.b; ...
-
通过使用!,它正在评估匿名函数(从而要求它运行)。 没有它,你会得到一个错误。 并且,正如其他人所说,如果您正在分配或评估它,它将反转函数返回的结果。 By using !, it's evaluating the anonymous function (thereby requiring it to run). Without that, you'd get an error. And, as others have said, it will invert the result of whatever ...
-
功能计划作为功能执行。 该函数返回一个对象。 就像你可以看到{ start... } 。 使用返回的对象,它会调出start函数。 这称为链接。 因此在设置功能后执行start功能。 奇怪的是超时被传递给没有参数的start函数。 The function schedule is executed as a function. That function returns an object. Like you can see with the { start... }. With the returned ...