text stringlengths 1 81 | start float64 0 10.1k | duration float64 0 24.9 |
|---|---|---|
arrow function which would be a little | 4,121.81 | 2.52 |
bit faster to type just say alright | 4,122.98 | 3.39 |
here's the function that I want to run | 4,124.33 | 4.56 |
when the form is submitted and what | 4,126.37 | 4.44 |
would I like to do well I'd first like | 4,128.89 | 3.33 |
to figure out alright what did the user | 4,130.81 | 3.84 |
actually type in and what the user typed | 4,132.22 | 4.59 |
in well that'll be document query | 4,134.65 | 7.8 |
selector task dot value get me the | 4,136.81 | 7.17 |
element with ID task that's the input | 4,142.45 | 4.2 |
field dot value gets the value of the | 4,143.98 | 3.99 |
input field which is what the user | 4,146.65 | 4.439 |
actually typed in and I can save that as | 4,147.97 | 6.96 |
like Const tasks that is what it is the | 4,151.089 | 6.96 |
user typed in and if I'm curious as to | 4,154.93 | 4.56 |
what the user typed in I can | 4,158.049 | 3.991 |
actually print it out to the JavaScript | 4,159.49 | 4.32 |
console and the way to do that is using | 4,162.04 | 4.11 |
a special function called console.log | 4,163.81 | 4.65 |
and that just logs something to the | 4,166.15 | 3.63 |
console the equivalent of printing | 4,168.46 | 2.7 |
something out in Python where just shows | 4,169.78 | 3.24 |
up in the Python terminal here this is | 4,171.16 | 3.42 |
going to show up in the JavaScript | 4,173.02 | 4.11 |
console and one other thing I'll add is | 4,174.58 | 4.89 |
by default forms will try and submit | 4,177.13 | 3.57 |
when you press the submit button like | 4,179.47 | 2.97 |
take you to another page we've seen this | 4,180.7 | 3.45 |
before already in the context of Django | 4,182.44 | 3.57 |
that when you submit a form it tries and | 4,184.15 | 3.93 |
submits another web request if I want to | 4,186.01 | 3.81 |
prevent that behavior stop the form from | 4,188.08 | 3.69 |
submitting it's a stop form from | 4,189.82 | 6.81 |
submitting I can return false at the end | 4,191.77 | 6.78 |
of my form submission handler to say | 4,196.63 | 3.66 |
don't actually submit the form we're | 4,198.55 | 3.03 |
gonna do everything client-side | 4,200.29 | 3.75 |
everything just inside of the browser so | 4,201.58 | 3.93 |
now this won't quite work yet but it'll | 4,204.04 | 3.6 |
be progress i refresh the page I'm gonna | 4,205.51 | 3.63 |
open up the JavaScript console so I can | 4,207.64 | 3.42 |
see what's going on if I add a task | 4,209.14 | 4.52 |
something just like foo press submit | 4,211.06 | 5.76 |
this now gets logged to the JavaScript | 4,213.66 | 4.63 |
console it's the equivalent of a way of | 4,216.82 | 3.18 |
like providing debugging information to | 4,218.29 | 2.97 |
myself to know all right | 4,220 | 3.96 |
I now have access to this value foo and | 4,221.26 | 4.41 |
it's also telling me what line of code | 4,223.96 | 4.77 |
logged it it was tasks HTML line 9 is | 4,225.67 | 5.52 |
the line of code that logged foo and so | 4,228.73 | 3.6 |
this can be useful when you're debugging | 4,231.19 | 2.73 |
a program when you want to see what the | 4,232.33 | 3.51 |
values of variables are you can just | 4,233.92 | 4.23 |
print them out using console log to | 4,235.84 | 3.45 |
figure out what's going on in your | 4,238.15 | 3.71 |
program and any particular point in time | 4,239.29 | 5.1 |
but what I want to do is not console dot | 4,241.86 | 4.39 |
log n what I want to do is really create | 4,244.39 | 4.86 |
a new element that I'm going to add into | 4,246.25 | 6.06 |
my body of the HTML so how can I do that | 4,249.25 | 5.07 |
well to create a new element for my | 4,252.31 | 3.9 |
document I can run a function called | 4,254.32 | 5.4 |
document dot create element followed by | 4,256.21 | 5.34 |
what type of element do I want to create | 4,259.72 | 4.68 |
well I have an unordered list a ul and | 4,261.55 | 5.01 |
every item inside of an unordered list | 4,264.4 | 5.25 |
is a list item in Li so I'll go ahead | 4,266.56 | 6.59 |
and create an Li element a list item and | 4,269.65 | 6.48 |
I'll save that in a variable that I'll | 4,273.15 | 6.34 |
call Li so I've created a new list item | 4,276.13 | 7.44 |
and this list items inner HTML the HTML | 4,279.49 | 6.81 |
content inside of that list item well | 4,283.57 | 5.04 |
that's just going to be tasks this | 4,286.3 | 4.26 |
variable from up here which is whatever | 4,288.61 | 4.65 |
the user typed in so I've now created | 4,290.56 | 5.52 |
newest item and said what GML should go | 4,293.26 | 4.35 |
inside of the list item it should be | 4,296.08 | 4.35 |
whatever task the user typed in and now | 4,297.61 | 5.91 |
I'm going to say document dot query | 4,300.43 | 6.03 |
selector tasks get me the element whose | 4,303.52 | 5.04 |
ideas tasks and that's gonna be this | 4,306.46 | 4.05 |
unordered list here the unordered list | 4,308.56 | 4.86 |
whose ideas tasks and if I have an HTML | 4,310.51 | 5.58 |
element I can add a new element inside | 4,313.42 | 7.86 |
of it by saying dot append Li and with | 4,316.09 | 7.02 |
that now is going to do is it's going to | 4,321.28 | 3.48 |
say get me the unordered list whose | 4,323.11 | 3.39 |
ideas tasks get me the element whose | 4,324.76 | 3.63 |
ideas tasks by a query selector here | 4,326.5 | 4.71 |
once I have that element append to the | 4,328.39 | 4.49 |
end of what's inside of that element | 4,331.21 | 5.13 |
this value Li which happens to be this | 4,332.88 | 5.56 |
new element that I've created a new list | 4,336.34 | 4.5 |
item so I've been able to add a new HTML | 4,338.44 | 4.35 |
element and this line of code is going | 4,340.84 | 4.11 |
to say add it to the Dom add it to the | 4,342.79 | 3.9 |
unordered list that I am here now | 4,344.95 | 7.77 |
constructing so now I rerun this I see | 4,346.69 | 7.71 |
tasks I type in something like foo I | 4,352.72 | 4.17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.