The Chinese custom is that the Chinese New Year is still celebrated before the fifteenth day of the first lunar month. Here I wish you my friends a happy old age.
These days coincide with the need for revision of the homepage of the company's website. After the company's staff was streamlined at the end of last year, one person had to do multiple jobs, and suddenly he realized that the burden was heavy. No, this is not something within my work scope, and unfortunately I also participated in it. The luck of the misfortune is the task assigned to me by the BOSS this time, which is exactly the front-end development task I have always been passionate about. I have been engaged in the development of backend management programs for the company's website before, and I have more to deal with business logic on the server side, and I have never had the opportunity to show my strength in front-end development that I am passionate about. Practice is the best way to test true knowledge. By solving the actual tasks assigned to me, it is a rare test. I learned a lot of scattered knowledge through books and various materials, but I didn’t get the opportunity to mix them together to make a comprehensive test, haha. There are so many ink traces in front of you, but they are all caused by depression for a long time, haha.
Let me first describe the task requirements: There is a JPG picture composed of five balls on the homepage of the company's website, which is used to navigate. After clicking on the text on each ball, the secondary page of the corresponding information will be opened. The corresponding Flash version is almost the same as the picture. One of the tasks assigned by my boss is: when the client browser installs the Flash file player, it displays the Flash version navigation, and vice versa. After getting the task, consider it for a moment. It is both front-end development and of course you need to consider browser compatibility. The best way to cross the gap between browsers is to use one or more mature JavaScript frameworks. Fortunately, there is a very mature and exquisite JS framework called: SWFObject.js.
The first time I came into contact with SWFObject.js was V1.5, but this time I used V2.1 to solve the problem. There are still some differences in usage between the two. Overall, I feel that V2.1 is a great leap forward compared to V1.5. V2.1 is more in line with the object-oriented JavaScript programming style in terms of the source code and usage process of the framework.
I will take you to experience this tossing journey from the perspective of a studyer who has been exploring JavaScript recently. Whether you are a novice like me or a veteran who is already skilled in writing various JS codes, I hope you can show mercy. I hope everyone points out the short-sightedness in my thinking and the mistakes in my words with a civilized attitude.
The following code is an example of usage that I adapted from an explanation document of SWFObject V1.5 (If you want to know more about V1.5, please click this link):
Copy the code