Open main menu

CDOT Wiki β

Changes

DPS909/OSD600 Fall 2017 Lab 11

4,366 bytes added, 01:22, 17 January 2018
Submission
<pre>
When I use Safari on my MacWith some browsers, I notice that <img> elements in my page don't seem to always have fire their onload event fire. Specifically, when I set the .src of an image to the same URL as it's already using, no load event fires. My code looks something like this:
var img = document.querySelector('#image-1234');
img.src = "http://some.url.com/image";
 
...
// Some where late in the code I set the URL to the same thing again
img.src = "http://some.url.com/image";
 
// I'd expect the onload event to fire a second time, but it doesn't always in this case!
Later on, I sometimes need to reset the image, and in some cases, it needs to use the same URL again. I expect to get an onload event firing every time I change the img.src, no matter what the URL is.
You can use CSS to indicate if your test passed or failed (e.g., set the <code>background-color</code> of the <code>document.body</code> to <code>red</code> after the first <code>onload</code> and then to <code>green</code> after the second, or do any other visual thing you want to indicate pass/fail).
'''NOTE''': your test case should be simple. Don't use extra JavaScript or CSS libraries. You don't need to use any special testing infrastructure. Just a basic HTML page with some JavaScript.
==Step 2. Host your Test Case on GH-PAGES==
* Opera
If you don't have access to a browser due to operating system issues, ask a friend to test for you. You can also try downloading Nightly versions of these browsers instead of building them yourself: * https://www.google.com/chrome/browser/canary.html* https://www.mozilla.org/en-US/firefox/channel/desktop/* https://webkit.org/downloads/* http://blogs.opera.com/desktop/streams/
Which browsers pass your test? Which fail?
|-
| 1
|Phil Henning|https://github.com/PhillypHenning/osd-lab11|https://phillyphenning.github.io/osd-lab11/testingspace.html|WIP
|-
| 2
|Michael Pierre|https://github.com/MPierre9/testHTML|https://mpierre9.github.io/testHTML/index.html|https://michaelpierreblog.wordpress.com/2017/12/16/async-image-load-test-and-code-reading/
|-
| 3
|Leonel Jara|https://github.com/lejara/ImageTestCase/tree/gh-pages|https://lejara.github.io/ImageTestCase/index.html|WIP
|-
| 4
|Jay Yin|https://github.com/jayyyin/webimgcheck/blob/master/webtest.html|https://jayyyin.github.io/webimgcheck/webtest.html|http://jyopensource.blogspot.ca/2017/12/testing-if-image-is-reloaded-even-if.html
|-
| 5
|Svitlana Galianova|https://github.com/svitlana-galianova/onLoadHtmlTest/|https://svitlana-galianova.github.io/onLoadHtmlTest/test.html|WIP
|-
| 6
|Joao Rodrigues|https://github.com/jmrodriguesgoncalves/lab11|https://jmrodriguesgoncalves.github.io/lab11/index.html|https://jmrodriguesgoncalves.blogspot.ca/2017/12/lab-11-gh-pages.html
|-
| 7
|Nicholas Krause|https://github.com/xerofoify/image-webtests|https://xerofoify.github.io/image-webtests/img_test.html|https://wordpress.com/post/nicholas95com.wordpress.com/238
|-
| 8
|Marvin Sanchez|https://github.com/msanchez5/imgTest|https://msanchez5.github.io/imgTest/|https://marvinrsanchez.wordpress.com/the-unexpected-results
|-
| 9
|Mat Babol|https://github.com/mmBabol/ImgLoad-TestCase|https://mmbabol.github.io/ImgLoad-TestCase/index.html|http://mmbabol.blogspot.ca/2017/12/async-image-load-test-with-gh-pages.html
|-
| 10
|Sean Prashad|https://github.com/SeanPrashad/ImgLoad/tree/gh-pages|http://seanprashad.com/ImgLoad/|http://seanprashad.com/blog/code-literacy.html
|-
| 11
|Avedis Zeitounilian|https://github.com/Avedis777/ImageLoader|https://avedis777.github.io/ImageLoader/|http://avedis777.blogspot.com/2017/12/playing-with-gh-pages.html
|-
| 12
|Haoyu Yang|https://github.com/feihaozi77/Image-loading-test|https://feihaozi77.github.io/Image-loading-test/index.html|http://haoyu1337.blogspot.ca/2017/12/working-with-gh-pages.html
|-
| 13
|Fateh Sandhu|https://github.com/Fatehsandhu/DPS909-Lab11|https://fatehsandhu.github.io/DPS909-Lab11/|https://firefoxmacblog.wordpress.com/2018/01/01/179/
|-
| 14
|Dan Epstein|https://github.com/Securter/Image_onLoadEventTest|https://securter.github.io/Image_onLoadEventTest/LoadFire.html|http://www.danepstein.ca/testing-image-onload-event-handler/
|-
| 15
|Steven De Filippis|https://github.com/St3v3n-D/html_img_onload_debug|https://st3v3n-d.github.io/html_img_onload_debug/|https://dps909.defilippis.ca/index.php/2017/12/31/debugging-imgs-onload-unexpected-behavior/
|-
| 16
|Azusa Shimazaki|https://github.com/azusaaz/test0001_onload|https://azusaaz.github.io/test0001_onload/|http://assmith2017.blogspot.ca/2017/12/code-reading-for-open-source.html
|-
| 17
|Anthony LoMagno|https://github.com/ajlomagno/osd600-Lab11/tree/gh-pages|https://ajlomagno.github.io/osd600-Lab11/|https://anthonylomagno.wordpress.com/2018/01/03/lab-11-github-pages/
|-
| 18
|Gaurav Verma|https://github.com/GauravV-02/OSD-Lab11/tree/gh-pages|https://gauravv-02.github.io/OSD-Lab11/index.html|https://gblogs2017.wordpress.com/2018/01/06/hosting-test-cases-on-gh-pages/
|-
| 19
|Parthkumar Patel|https://github.com/ppatel221/OSD-11|https://ppatel221.github.io/OSD-11/|https://ppatel221.wordpress.com/2018/01/05/working-wit-github-pages/
|-
| 20
|Mithilan Sivanesan|https://github.com/Mithilan16/ODS_Lab11/tree/gh-pages|https://mithilan16.github.io/ODS_Lab11/|https://mithilanblog.wordpress.com/2018/01/06/gh-pages/
|-
| 21
|Marco Beltempo|https://github.com/marcobeltempo/OSD600/blob/gh-pages/lab11.html|https://marcobeltempo.github.io/OSD600/lab11.html|https://www.marcobeltempo.com/osd600-labs/debugging-image-load/
|-
| 22
|Eric Suarez|https://github.com/ericsuhn/onLoadTest|https://ericsuhn.github.io/onLoadTest/|https://esoscode.wordpress.com/2018/01/06/github-pages/
|-
| 23
|Igor Naperkovskiy|https://github.com/naperkovskiy/Lab-11|https://naperkovskiy.github.io/Lab-11/conceptCars|https://naperkovskiyblog.wordpress.com/2018/01/17/lab-11/
|-
| 24
41
edits