js detect https
<p>i am trying to find how can i "detect" width JavaScript if i am ih http or https environment</p>

<p>I am calling ajax request so if i am in https and call http ajax i get 302 Moved Temporarily</p>

<p>I was thinking of get the current window.location.href and do a strinh manipulation</p>

<p>Any suggestion is welcome. </p>
