一个简单的表格:
<form action="https://httpbin.org/post" method="post">
<button name="should-be-sent" type="submit">Submit</button>
</form>
使用preventDefault
停止表单提交,然后使用.submit()
提交表单的JavaScript。
var form = document.querySelector('form');
form.addEventListener('submit', function(e) {
e.preventDefault();
form.submit();
});
这是一个小提琴,将显示已发送(或未发送)的数据:https://jsfiddle.net/davidpauljunior/mg86q8mb/
我希望表单数据包含should-be-sent
,但在Firefox中它不包含Started by user Ayotunde Salako
Building in workspace /var/lib/jenkins/workspace/project
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://user:pass@bitbucket.org/company/repo.git # timeout=10
Fetching upstream changes from https://user:pass@bitbucket.org/company/repo.git
> git --version # timeout=10
> git fetch --tags --progress https://user:pass@bitbucket.org/company/repo.git +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://user@bitbucket.org/companyhttps://user@bitbucket.org/company/repo.gitids/repo.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1051)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1082)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1720)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:401)
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://user@bitbucket.org/company/repo.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: remote: Invalid username or password. If you log in via a third party service you must ensure you have an account password set in your account profile.
fatal: Authentication failed for 'https://user@bitbucket.org/company/repo.git/'
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImp l.java:1752)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials (CliGitAPIImpl.java:1495)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.jav a:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:795)
... 11 more
ERROR: null
Finished: FAILURE
。这个问题有一个简单的方法吗?