Consider the following JavaScript code:
<script type="text/javascript" charset="utf-8>
function goForLogin() {
var xmlhttp;
xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST","/account/login",true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("email=test%40test.com&password=1");
}
</script>
I am required to run this code in module test/index.
Upon logging the request with tampadata, I noticed that the URL is
http://dev.server.com/test/account/login
. How can I remove test
from the URL as it should be directed to a different module?
If I change the url to dev.server.com/account/login/
in the xmlhttp.open
function, the resulting output will be:
http://dev.server.com/test/dev.server.com/account/login/
.