Whats the best way to determine if user is on HTTP or HTTPS connection on specific page without usage of server-side dynamic language?
I have a page with form, which posts to some URL and I would like that URL to be HTTP or HTTPS – according to current connection.
Perhaps there’s some solution like:
<form action="://www.mysite/form/post" method="post">
which would set HTTP or HTTPs accordingly.
If that’s impossible to set with just HTML, whats the best way to do it with javascript?
Thanks for help
Nearly there 🙂
it’s
More about protocol relative URLs
However, as @Petra mentioned, of course this makes sense only when the target is on a different domain. Otherwise, you would just use normal relative URLS:
/form/post