<script runat="server"> <WebMethod()> _ Public Shared Function Session(ByVal key As String) As String Return DirectCast(HttpContext.Current.Session(key), String) End Function </script> <script type="text/javascript"> var cult = ""; // $(window).load(function() { function pageLoad(sender, arg) { PageMethods.Session("Lang", OnCallComplete, OnCallError); } function OnCallComplete(result, userContext, methodName) { cult = result; var p = $("#b"); var pos = p.position(); var sub = document.getElementById("men"); sub.top = pos.top + 70; alert(cult); if (cult == "en-US") { sub.left = pos.left; } if (cult == "ar-LB") { sub.left = pos.left - 70; } $("#men").offset({ left: sub.left, top: sub.top }); } function OnCallError(error, userContext, methodName) { if (error !== null) { alert(error.get_message()); } } // }); </script>
$(window).load(function() { PageMethods.Session("Lang", OnCallComplete, OnCallError); }
window.load
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)