I currently have a visual web part that displays clocks from different time zones, using the jClocksGMT library as provided here in the .ascx file. However, instead of hardcoding the timezones I want to be able to pass the correct GMT values from the .ascx.cs file and have the clocks update accordingly. However I can't seem to find a straight answer for how to do this. How is it done?
Here is an example of the code from my .ascx file:
<!doctype html>
<html>
<head>
<title>jClocksGMT v. 2.0</title>
<style>
body { font-family: Arial, sans-serif; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://dev/Style%20Library/jClocksGMT-master/css/jclocksGMT.css"/>
<script type="text/css" src="http://dev/Style%20Library/jClocksGMT-master/css/jClocksGMT.css"></script>
<script type="text/javascript" src="http://dev/Style%20Library/jClocksGMT-master/js/jClocksGMT.js"></script>
<script type="text/javascript" src="http://dev/Style%20Library/jClocksGMT-master/js/jquery.rotate.js"></script>
</head>
<body>
<div id="clock_city"></div>
<script>
$(document).ready(
function () {
$('#clock_city').jClocksGMT(
{
title: 'City, USA',
offset: '-7' // <-- Value I want to change via .ascx.cs file
//imgpath: 'http://dev/Style Library/jClockGMT-master/'
});
}
)
</script>
</body>
</html>
Edit: What I mean is that I do not know how to update the values via client-side. Once I have the correct offset value in the .ascx.cs file, how do I get it into the client-side jQuery?