Skip to content

Commit 9e02617

Browse files
committed
Use jQuery ready
window.onload will overwrite and isn't really the best place since it doesn't take into account when the DOM is ready. We have jQuery so use it to initialize correctly.
1 parent b46066d commit 9e02617

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

_includes/developers_cards.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
//assume Mustache is loaded
7474
//assume Meetup is loaded
7575

76-
window.onload = function(){
76+
$(function(){
7777
var getPaginatorLinks = function(results) {
7878
var current_page = document.location.search.match(/page=(\d+)/);
7979
current_page = current_page == null ? 1 : parseInt(current_page[1]);
@@ -151,5 +151,5 @@
151151

152152
return dev;
153153
}
154-
}
154+
});
155155
</script>

_includes/meetup_cards.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//assume Mustache is loaded
3131
//assume Meetup is loaded
3232

33-
window.onload = function(){
33+
$(function(){
3434
var MAX_EVENTS = 5;
3535

3636
var EVENTS_URL = 'https://api.meetup.com/2/events?' +
@@ -87,5 +87,5 @@
8787
event.formattedDate = formatDate(new Date(event.time));
8888
return event;
8989
}
90-
}
90+
});
9191
</script>

0 commit comments

Comments
 (0)