Skip to content

Commit

Permalink
Avoid browser back button form cache and also include -n
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Dec 5, 2017
1 parent 5aa0566 commit 797cbe8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions web/WEB-INF/views/test-caget.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
</tr>
</tbody>
</table>
</form>
<form id="caget-form" action="caget" method="get" style="display: none;">
</form>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/test-caget.js?v=${initParam.releaseNumber}"></script>
Expand Down
8 changes: 6 additions & 2 deletions web/resources/js/test-caget.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ jlab.epics2web.doGet = function () {
/*Replace all commas with space, split on any whitespace, filter out empty strings*/
let tokens = input.replace(new RegExp(',', 'g'), " ").split(/\s/).filter(Boolean);

let form = $("#caget-form");
let form = $('<form action="caget" method="get" style="display: none;"></form>');

for (let i = 0; i < tokens.length; i++) {
form.append('<input type="text" name="pv" value="' + tokens[i] + '"/>');
}

if($("#n").prop('checked')) {
form.append('<input type="text" name="n" value="Y"/>');
}

form.submit();
form.appendTo('body').submit();
}
};

Expand Down

0 comments on commit 797cbe8

Please sign in to comment.