So I'm going around with DJGengo, HTML and Javascript for the first time, a script to display on an updated counter Writing panna. When I was working without using text and using DOM I decided to update it to use images instead, but I can not take it to work.
Below is html to display the initial duration / counter
{% extends 'vices / index.html'%} {% block content%} & lt; Script type = "text / javascript" src = "/ site_media / js / clock.js" & gt; & Lt; / Script & gt; & Lt; Body onload = "period ()" & gt; & Lt; Img src = "/ site_media / picture / clock / 0.jpg" id = "second_1" /> & Lt; / Body & gt; {% Endblock%} This is the JavaScript function that I am calling for testing purposes, I want to set it to set for a specified distinct value.
Function duration () {// irrelevant logic (works before trying to import a picture) document. GetElementById ("second_1"). Src = "/site_media/images/clock/1.jpg" Settime "(" Duration () ", 1000)} When I embed javascript in HTML file then it is OK But when I drag javascript into an external file, I can not seem to change this image.
Am I missing something important? < / Div>
Duplication of your {% block content%} ; Body & gt; element - usually a External template like index.html already has its own body, which makes me wonder if your onLoad is ever being called.
Comments
Post a Comment