单击重置后将占位符值恢复到搜索框(Restoring placeholder value to a search box after reset has been clicked)
我正在编辑一些带有变量的搜索框的javascript,如下所示
var secondSearchTerm = $('#2nd-search').val();
在HTML代码'2nd-search'中有一个占位符'输入搜索词'
我还有一个重置按钮,清除搜索,如下所示:
$("#2nd-reset-btn").on("click", function () { return myNetwork.resetSecondSearch(); })
我想要做的是在单击重置时让搜索框重新填充占位符。 现在,最后输入的术语仍保留在搜索框中。
关于如何编辑代码来执行此操作的任何想法?
非常感谢!
I am editing some javascript that has a search box with a variable as follows
var secondSearchTerm = $('#2nd-search').val();
In the HTML code '2nd-search' has a placeholder 'Enter search term'
I also have a reset button that clears the search as follows:
$("#2nd-reset-btn").on("click", function () { return myNetwork.resetSecondSearch(); })
What I would like to do is to get the search box to re-populate with the placeholder when reset is clicked. Right now the last entered term remains in the search box.
Any ideas on how I can edit the code to do this?
Many thanks!
原文:https://stackoverflow.com/questions/37745395
最满意答案
是的,这就是它应该工作的方式:通过将指针指向值类型数据,在mono_runtime_invoke()的arguments数组中传递值类型。
Yes, that is the way it's supposed to work: value types are passed in the arguments array in mono_runtime_invoke () by taking the pointer to the value type data.
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
我使用std::vector
和std::vector 在c ++端定义相同的结构。 重要的细节,需要在问题中。 但不,那永远不会奏效。 C ++语言类型没有互操作故事,类实现细节在编译器实现之间变化太大。 或者就此而言,在同一编译器中变化太大。 像迭代器调试这样的标准辅助工具会更改C ++标准库对象的布局。 Pinvoke互操作基于C语言类型。 您现在拥有的C#声明是否匹配 typedef struct LabeledData { float* floatAr ... -
问题是如此微不足道 - 我在我的C ++代码中搞砸了单声道lib路径。 显然,您需要提供前缀,而不是完整路径。 所以,就我而言,我不得不使用: mono_set_dirs("mypath/lib", "mypath/etc"); 最后没有使用mono 。 The problem was so trivial - I messed up the mono lib path in my C++ code. Apparently, you need to provide a prefix, and not th ...
-
我设法改变了CudafyTranslator中的CUDAfy .NET库。 结构在内存流中之后,我添加了: StreamReader sr = new StreamReader(structs); String sStructs = sr.ReadToEnd(); String sNewStructs; foreach(string structName in cm.Types.Values.Select(t => t.Name)) ...
-
是的,这就是它应该工作的方式:通过将指针指向值类型数据,在mono_runtime_invoke()的arguments数组中传递值类型。 Yes, that is the way it's supposed to work: value types are passed in the arguments array in mono_runtime_invoke () by taking the pointer to the value type data.
-
使用Embedded Mono调试如何在C#代码中设置断点?(Debugging w/Embedded Mono how to set breakpoints in C# code?)[2022-03-10]
当我们的应用程序打印堆栈跟踪(Environment.Stacktrace)时,它们是否有源文件和行信息? 如果没有,您应该检查程序集旁边是否有mdb符号文件。 如果您的托管代码是使用.NET的编译器构建的,那么您将拥有pdb文件,而Mono无法加载这些文件。 使用pdb2mdb工具将它们转换为mdb文件。 还要检查堆栈跟踪中的文件路径是否与主机上实际源文件的路径匹配。 When our app prints stack traces (Environment.Stacktrace) do they hav ... -
如果我将函数参数作为C代码中的指针传递,它就可以工作。 C#正确接收它。 以上代码已修改自: typedef long long (*FibonacciNumber) (long long); ... long long number = fibonacciNumber(entryNumber); 至: typedef long long (*FibonacciNumber) (long long *); ... long long number = fibonacciNumber(&entryNumbe ...
-
这有效: MonoArray* theArray = mono_array_new(domain, containsClass, 1); mono_array_set(theArray, MonoObject*, 0, containsObject); args[0] = theArray; mono_runtime_invoke(returnElementMethod, NULL, args, &exception); // <--- as expected, outputs "In ReturnElem ...
-
您必须自己启动新线程,然后在mono_thread_attach之前调用mono_runtime_invoke 。 假设在单独的线程上调用thread_callback ,它就是这样的样子: void thread_callback (MonoMethod *method, void **args) { mono_thread_attach (mono_get_root_domain ()); mono_runtime_invoke (method, NULL, args, NULL); } ...