determine page UI culture throgh javascript

Posted by mj-y on Stack Overflow See other posts from Stack Overflow or by mj-y
Published on 2012-11-19T09:26:24Z Indexed on 2012/11/19 11:05 UTC
Read the original article Hit count: 264

Filed under:
|

I have two div tags in my html code as shown below. I want to change their float property depending on page UI culture ( Ui culture is en-US or fa-IR) ... I think I can use java script to do so. but I don't know how can I get the UI Culture through Javascript. I want a code in if condition to determine the Ui culture ... thx in advance for your help...

<div id="zone1" style="float: left;"><img alt="" src="~/IconArrow.png" /> &nbsp;</div>
<div id="zone2" style="float: left;"><img alt="" src="~/IconHome.png" /></div>

<script type="text/javascript">
if(/* ui culture is fa-IR*/)
{
    document.getElementById("zone1").style.float = "right";
    document.getElementById("zone2").style.float = "right";     
} 
</script>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html