小编Ran*_*ion的帖子

如何在按钮onclick动作的新弹出窗口中提交表单

我想要一个表单,需要在按钮onclick动作的新弹出窗口中将其提交到URL.我想要这样的东西.

<form id = "test" name = "test" action = "preview.jsp">
    Email : <input type = "text" name = "email"/>
    <button id = "submitButton" onclick = "submitFormInPopUp()"/>
</form> 
Run Code Online (Sandbox Code Playgroud)

那么如何编写这个函数submitFormInPopUp(),它在新的弹出页面中发布到动作网址.

谢谢

Jitendra

html javascript jquery

2
推荐指数
1
解决办法
2万
查看次数

简单的c ++矢量程序没有编译

我刚刚开始学习c ++并编写了这个非常简单的程序来使用向量.但它没有编译.我想看看订阅一个不存在的元素的行为.

#include <iostream>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main() {
    vector<int> list;
    cout << list[0];
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

当我在我的mac上使用它编译它时cc main.cpp,我得到了一个难以理解的错误.

Undefined symbols for architecture x86_64:
  "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int)", referenced from:
      _main in main-651b3f.o
  "std::__1::cout", referenced from:
      _main in main-651b3f.o
  "std::terminate()", referenced from:
      ___clang_call_terminate in main-651b3f.o
  "operator delete(void*)", referenced from:
      std::__1::__vector_base<int, std::__1::allocator<int> >::~__vector_base() in main-651b3f.o
  "___cxa_begin_catch", referenced from:
      ___clang_call_terminate in main-651b3f.o
  "___gxx_personality_v0", referenced from:
      _main in main-651b3f.o
      Dwarf …
Run Code Online (Sandbox Code Playgroud)

c++ vector c++11

1
推荐指数
1
解决办法
258
查看次数

将 nlohmann/json 构建为 bazel 库会出现“无构建”错误

我有一个非常简单的 bazel 项目,我试图将https://github.com/nlohmann/json添加为依赖项。为了实现这一目标,我json在本地克隆了存储库,并BUILD在存储库的根目录中添加了一个文件以生成cc_library包含单个包含文件的json.hpp文件。但当我构建它时,它总是抱怨没有什么可构建的。

\n
\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 json\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 BUILD\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 // all files under nlohmann/json repo.\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 myproject\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 BUILD\n\xe2\x94\x82\xc2\xa0\xc2\xa0 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 Main.cpp\n\xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 WORKSPACE\n
Run Code Online (Sandbox Code Playgroud)\n

json/构建:

\n
cc_library(\n    name = "json",\n    hdrs = ["single_include/nlohmann/json.hpp"],\n    includes = ["json"],\n    visibility = ["//visibility:public"],\n)\n
Run Code Online (Sandbox Code Playgroud)\n

上述构建成功,但没有生成库。请注意输出中的“(没有任何内容可构建)”消息。

\n
bazel build :json\nINFO: Analyzed target //json:json (0 packages loaded, 0 targets configured).\nINFO: Found 1 target...\nTarget //json:json up-to-date (nothing to build)\nINFO: Elapsed time: 0.065s, Critical Path: 0.00s\nINFO: 1 process: 1 internal.\nINFO: …
Run Code Online (Sandbox Code Playgroud)

c++ bazel nlohmann-json

1
推荐指数
1
解决办法
1798
查看次数

Apache Commons的FileUtils.write性能 - Java

我已经通过javadoc但我找不到任何东西.它内部缓冲数据吗?如果是,由于没有关闭/刷新操作,它如何确保所有数据都已写入.如果它没有缓冲,那么每次调用都会进入磁盘吗?

http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#write(java.io.File,java.lang.CharSequence,java.nio.charset. Charset,布尔)

我在这里查看了源代码,http://grepcode.com/file/repo1.maven.org/maven2/commons-io/commons-io/2.4/org/apache/commons/io/FileUtils.java#FileUtils.openOutputStream %28java.io.File%2Cboolean%29它似乎没有做任何缓冲.它每次都打开一个流.

java apache-commons

0
推荐指数
1
解决办法
1538
查看次数

标签 统计

c++ ×2

apache-commons ×1

bazel ×1

c++11 ×1

html ×1

java ×1

javascript ×1

jquery ×1

nlohmann-json ×1

vector ×1