I’m having some issues with my javascript on a particular page. This is very weird.
http://www.rayku.com/tutorshelp
How it is supposed to work is fetch from an external html file every time I flip through the tabs on the right. However, after 3 seconds, it just stops working. It doesn’t matter how many times you flip before the 3 seconds (or any for that matter). After the 3 seconds, it just stops flipping.
Any ideas?
Yes, keep an eye on your web console, it will alert you of these types of issues.
When you click on a tab the console reads:
tutorshelp-ajax.js:9 Uncaught TypeError: Cannot call method 'load' of nullIf you go to line 9 you’ll see:
$('#video-content').load('/help-external/video'+step+'.html');Since the message is cannot call method ‘load’ of ‘null’ it means that $(‘#video-content’) is null.
This is happening because they are not wrapped in $(document).ready(); and they are being set up before the
video-contentid even exists.