Just to start off, I want to mention that my knowledge of JavaScript and specifically jQuery is quite limited.
I've encountered an issue with some JavaScript and jQuery loading on my webpage.
1) I have written some code on JSFiddle http://jsfiddle.net/Gilera/mT9pV/1/. The code includes JavaScript for the timezone converter and a jQuery function for sliding the hidden div. When using jsfiddle onDomready, the code runs fine and displays both the time and the sliding functionality. However, when using onLoad, only the hidden div works but not the timezone converter. Any suggestions on how to make both work in onLoad mode on JSFiddle?
2) Additionally, when I compile the code and test the website in a browser, the times load but the hidden divs don't show up when clicked. How can I modify the chan2.js script to run onDomready or maybe add a script above it to locate the jQuery library?
I apologize for the lengthy post with all the code details, as this is new territory for me. Any assistance would be highly appreciated.
Below is the code snippet I am using:
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style2.css" rel="stylesheet" type="text/css" />
</head>
<div class="schedule"><div class="event"><ul class="guides"><li class="icon"><img src="" alt="" width="26" height="27" class="icon"/></li><li class="time"><span data-utc="9:05"></span></li><li class="game">Team A vs Team B</li></ul></div><div class="place"><ul class="venue"><li class="field">Field A</li></ul></div></div>
<div class="schedule"><div class="event"><ul class="guides"><li class="icon"><img src="" alt="" width="26" height="27" class="icon"/></li><li class="time"><span data-utc="9:05"></span></li><li class="game">player A vs Player B</li></ul></div><div class="place"><ul class="venue"><li class="field">Court 3</li></ul></div></div>
<div id='out'></div>
<script type='text/javascript' src='times2.js'></script>
<script type='text/javascript' src='chans2.js'></script>
<body>
</body>
</html>
CSS style2.css
@charset "utf-8";
.event {
width: 600px;
height: 38px
}
...
Javascript times.js
window.onload = init;
function init(){
DisplayTimes();
}
function DisplayTimes(){
//legal formats: 1/10-13:00 for date and time
// : 13:00 for time - presumes utc date is same as local date
var dd = new Date();
...
Jquery chans2.js
$(".event").click(function(){
//hide all rrshow
$(".place").hide();
//show only required rrshow
$(this).parent().find(".place").show();
});
Thank you
EDIT: Apologies for posting the wrong code initially, I have now updated chan2.js with what I'm currently using.