javascript form submit is not working in https -
javascript submit not working in https.
javascript code
function apply() { document.fileinfo.action='<%=uploadjsp%>'; // uploadjsp = https://localhost/upload.jsp document.fileinfo.submit(); }
html code
<form name="fileinfo" action="upload.jsp" enctype="multipart/form-data" method="post"> ... </form>
result of newtwork capture on ie developer tool,
... domcontentloaded (event) + 184ms - load (event) + 197ms -
on load(event) break
this code working on http (uploadjsp = http://loaclhost/upload.jsp)
i don't know wrong.
please advice me solve problem
firstly, have tried printing value of document.fileinfo.action
in first snippet after has been assigned = "<%=uploadjsp%>"
?
<%= {code} %>
processed when server sends html documents, if script in separate file html, or server doesn't process code in between <script>
tags, document.fileinfo.action = "<%=uploadjsp%>"
instead of document.fileinfo.action = "https://localhost/upload.jsp"
intended.
second, don't need set action form again in javascript since it's set in html. so, instead of worrying how can pass correct value in first snippet, suggest removing document.fileinfo.action = "<%=uploadjsp%>"
line altogether.
Comments
Post a Comment