我想要一个表单,需要在按钮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
我刚刚开始学习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) 我有一个非常简单的 bazel 项目,我试图将https://github.com/nlohmann/json添加为依赖项。为了实现这一目标,我json在本地克隆了存储库,并BUILD在存储库的根目录中添加了一个文件以生成cc_library包含单个包含文件的json.hpp文件。但当我构建它时,它总是抱怨没有什么可构建的。
\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\nRun Code Online (Sandbox Code Playgroud)\njson/构建:
\ncc_library(\n name = "json",\n hdrs = ["single_include/nlohmann/json.hpp"],\n includes = ["json"],\n visibility = ["//visibility:public"],\n)\nRun Code Online (Sandbox Code Playgroud)\n上述构建成功,但没有生成库。请注意输出中的“(没有任何内容可构建)”消息。
\nbazel 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) 我已经通过javadoc但我找不到任何东西.它内部缓冲数据吗?如果是,由于没有关闭/刷新操作,它如何确保所有数据都已写入.如果它没有缓冲,那么每次调用都会进入磁盘吗?
我在这里查看了源代码,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它似乎没有做任何缓冲.它每次都打开一个流.