I have looked at some top StackOverflow responses for how to reuse a header. I cannot get them to work.
- I have 5 pages
- I
changePage
between each of them - I have hardcoded the same header for all 5 pages, 5 times replication
- I listen to
document.ajaxStart()
and make a loading animated gif appear - I listen to
document.ajaxStop()
and make the animated gif disappear - The only way I can get this to work accross all 5 pages is to name the img element to id=loading1, id=loading2, id=loading3,id=loading4,id=loading5
- If I do not have unique names for the loading images, then only one image works.
- Obviously,the solution is to RE_USE the header so that the img id=same_ID_for_ALL_5_pages
- Again, both of the top-rated stack overflow answers are too dense/cryptic for me to understand or reproduce.
Question(s):
- Can someone please simplify or explain how I can write proper, elegant code given my simple requirements.
- And can someone pat me on the back for trying to do simple things with a poorly written library?
Thank you.