This HTML5 document contains 134 embedded RDF statements represented using HTML+Microdata notation.

The embedded RDF content will be recognized by any processor of HTML5 Microdata.

PrefixNamespace IRI
n92018-07-23T10:13:
n5http://ods-qa.openlinksw.com:8896/about/id/entity/https/discourse.mozilla.org/t/image-gallery-assessment/
n10https://discourse.mozilla.org/t/image-gallery-assessment/
pwdrhttp://www.w3.org/2007/05/powder-s#
schemahttp://schema.org/
n122018-07-25T14:29:
rdfshttp://www.w3.org/2000/01/rdf-schema#
rdfhttp://www.w3.org/1999/02/22-rdf-syntax-ns#
n2http://ods-qa.openlinksw.com:8896/proxy-iri/
n6http://ods-qa.openlinksw.com:8896/about/id/https/discourse.mozilla.org/t/image-gallery-assessment/
xsdhhttp://www.w3.org/2001/XMLSchema#
siochttp://rdfs.org/sioc/ns#
n8https://discourse.mozilla.org/t/image-gallery-assessment/24687#
Subject Item
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
rdf:type
schema:DiscussionForumPosting
schema:datePublished
n9:09Z 2018-07-25T14:26:01Z
schema:publisher
n2:a439a40f76abb0743be66578b73891a13f811734
pwdr:describedby
n5:24687 n6:24687
sioc:container_of
n2:dabef28c15cabc10013b50c38615f40572779621
schema:mainEntityOfPage
n10:24687
schema:author
n2:49e38be0ae54a2a007e6fbac347db1a943248655 n2:2339c2bbfb9e73cc5e66c8fa933fd13c9d8c4edc
schema:position
#17 #18
schema:dateModified
n12:54Z
schema:articleBody
AvidLearner: Here, my function sourceAlter only has the parameter e and therefore, I did not pass any parameters when I called the function, hence image[i].addEventListener('click', sourceAlter) without any parentheses and parameters. However, what if my function requires two parameters, e.g. sourceAlter(a, b) , how do I pass on the parameters to said function? I don’t quite understand how looping works in JavaScript. It somehow does not make sense to me how for (...) in my code above worked. I do know that it loops five times (as expressed in the conditional statement i < image.length ) and that whenever an image with the order i is clicked, we run a function. But, when we click picture 1, 2,3 and then 1 again, it somehow worked? There is not decrement in the for loop, so how did it happen? Is the loop run over again after each action (in this case, click (but doesn’t have to be necessarily a click))? So to answer the first question, this isn’t the simplest, but it is possible. This stack overflow answer is useful, and contains multiple ways of doing it: https://stackoverflow.com/questions/256754/how-to-pass-arguments-to-addeventlistener-listener-function For the second question, the loop only runs once. But one of the main things the loop does is to add an onclick handler to each image, using this code: newImage.onclick = function(e) { var imgSrc = e.target.getAttribute('src'); displayImage(imgSrc); } because that handler is added to each image, it is run every time an image is clicked. I’m a little confused on how event objects work. In my for loop the following code works: for (i = 1; i <= 5; i++) { var newImage = document.createElement('img'); newImage.setAttribute('src', "images\/pic" + i + ".jpg"); thumbBar.appendChild(newImage); function displayThumb(clickedImage) { var imageThumb = clickedImage.target.getAttribute('src'); displayedImage.setAttribute('src', imageThumb); }; newImage.addEventListener('click', displayThumb); } While the following does not work: for (i = 1; i <= 5; i++) { var newImage = document.createElement('img'); newImage.setAttribute('src', "images\/pic" + i + ".jpg"); thumbBar.appendChild(newImage); function displayThumb(clickedImage) { var imageThumb = newImage.getAttribute('src'); displayedImage.setAttribute('src', imageThumb); }; newImage.addEventListener('click', displayThumb); } In other words, what is the event object in the displayThumb function doing in the first example that allows it to be functioning on the entire loop, whereas in the second example the loop is completed, and the click events only function on the last thumbnail.
schema:headline
"Image gallery" assessment
n8:interactionStatistic
n2:49353a77632fd9e52aecc215b5837e5d39453b50 n2:8f522bccbcfce596fbee8b2897bd0465f1742e5a
Subject Item
n2:f340c5cd6246e7991156d973100b09c0113b88a5
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 114
pwdr:describedby
n5:24687 n6:24687
rdf:object
n2:dabef28c15cabc10013b50c38615f40572779621
rdf:predicate
sioc:container_of
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:2138357a666228e8fd3853708b41320ebd57055c
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 115
pwdr:describedby
n5:24687 n6:24687
rdf:object
AvidLearner: Here, my function sourceAlter only has the parameter e and therefore, I did not pass any parameters when I called the function, hence image[i].addEventListener('click', sourceAlter) without any parentheses and parameters. However, what if my function requires two parameters, e.g. sourceAlter(a, b) , how do I pass on the parameters to said function? I don’t quite understand how looping works in JavaScript. It somehow does not make sense to me how for (...) in my code above worked. I do know that it loops five times (as expressed in the conditional statement i < image.length ) and that whenever an image with the order i is clicked, we run a function. But, when we click picture 1, 2,3 and then 1 again, it somehow worked? There is not decrement in the for loop, so how did it happen? Is the loop run over again after each action (in this case, click (but doesn’t have to be necessarily a click))? So to answer the first question, this isn’t the simplest, but it is possible. This stack overflow answer is useful, and contains multiple ways of doing it: https://stackoverflow.com/questions/256754/how-to-pass-arguments-to-addeventlistener-listener-function For the second question, the loop only runs once. But one of the main things the loop does is to add an onclick handler to each image, using this code: newImage.onclick = function(e) { var imgSrc = e.target.getAttribute('src'); displayImage(imgSrc); } because that handler is added to each image, it is run every time an image is clicked.
rdf:predicate
schema:articleBody
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:c48347503b67701e1b4aef9853690a765c2b6877
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 116
pwdr:describedby
n5:24687 n6:24687
rdf:object
n2:2339c2bbfb9e73cc5e66c8fa933fd13c9d8c4edc
rdf:predicate
schema:author
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:db25044d4662e717bd49716a226e1ead43702a1a
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 117
pwdr:describedby
n5:24687 n6:24687
rdf:object
n9:09Z
rdf:predicate
schema:datePublished
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:33c321d6764726f455aa9e1db11f510b5b5d25c9
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 158 Embedded HTML5 Microdata Statement 118
pwdr:describedby
n5:24687 n6:24687
rdf:object
"Image gallery" assessment
rdf:predicate
schema:headline
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:4a4b20efd4c85c563a7d7471dbb40506e0f316bc
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 119
pwdr:describedby
n5:24687 n6:24687
rdf:object
#17
rdf:predicate
schema:position
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:17711e35129fbe168c915a002147e6ac23085026
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 120 Embedded HTML5 Microdata Statement 162
pwdr:describedby
n5:24687 n6:24687
rdf:object
schema:DiscussionForumPosting
rdf:predicate
rdf:type
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:c66e669d7ae98a9e1b956dceebad54c832224d7c
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 163 Embedded HTML5 Microdata Statement 121
pwdr:describedby
n5:24687 n6:24687
rdf:object
n2:49353a77632fd9e52aecc215b5837e5d39453b50
rdf:predicate
n8:interactionStatistic
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:f8c008045482c8ddd7e272eaad08ba6253baad3c
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 122 Embedded HTML5 Microdata Statement 164
pwdr:describedby
n5:24687 n6:24687
rdf:object
n2:8f522bccbcfce596fbee8b2897bd0465f1742e5a
rdf:predicate
n8:interactionStatistic
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:6cbe63abaa85acd3a653f1a61a4f254ef382a742
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 154
pwdr:describedby
n5:24687 n6:24687
rdf:object
I’m a little confused on how event objects work. In my for loop the following code works: for (i = 1; i <= 5; i++) { var newImage = document.createElement('img'); newImage.setAttribute('src', "images\/pic" + i + ".jpg"); thumbBar.appendChild(newImage); function displayThumb(clickedImage) { var imageThumb = clickedImage.target.getAttribute('src'); displayedImage.setAttribute('src', imageThumb); }; newImage.addEventListener('click', displayThumb); } While the following does not work: for (i = 1; i <= 5; i++) { var newImage = document.createElement('img'); newImage.setAttribute('src', "images\/pic" + i + ".jpg"); thumbBar.appendChild(newImage); function displayThumb(clickedImage) { var imageThumb = newImage.getAttribute('src'); displayedImage.setAttribute('src', imageThumb); }; newImage.addEventListener('click', displayThumb); } In other words, what is the event object in the displayThumb function doing in the first example that allows it to be functioning on the entire loop, whereas in the second example the loop is completed, and the click events only function on the last thumbnail.
rdf:predicate
schema:articleBody
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:c3643c7aa2e3044bf147cc353bc5c99cb029fc65
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 155
pwdr:describedby
n5:24687 n6:24687
rdf:object
n2:49e38be0ae54a2a007e6fbac347db1a943248655
rdf:predicate
schema:author
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:349e01343f5248f6c6b69e08aca8b6c12abef35d
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 156
pwdr:describedby
n5:24687 n6:24687
rdf:object
n12:54Z
rdf:predicate
schema:dateModified
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:8ed00af1f065afbaaf8d88933ec53ee616ff902b
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 157
pwdr:describedby
n5:24687 n6:24687
rdf:object
2018-07-25T14:26:01Z
rdf:predicate
schema:datePublished
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:1d125eabe55c27a37f3d0997c56a9ec6e2ed3827
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 159
pwdr:describedby
n5:24687 n6:24687
rdf:object
n10:24687
rdf:predicate
schema:mainEntityOfPage
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:f2af06b78dac8b4136db2988b3c6b77f9d221002
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 160
pwdr:describedby
n5:24687 n6:24687
rdf:object
#18
rdf:predicate
schema:position
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166
Subject Item
n2:7a836945680ba61701b3a873a6695be0b6a0d37d
rdf:type
rdf:Statement
rdfs:label
Embedded HTML5 Microdata Statement 161
pwdr:describedby
n5:24687 n6:24687
rdf:object
n2:a439a40f76abb0743be66578b73891a13f811734
rdf:predicate
schema:publisher
rdf:subject
n2:51c0ca3b0d00d753911c01ce981a77ef6e161166