Think for your customers
I’m posting my new website this week if all goes right. I’ve spent the last few days cleaning up the many details. One thing that bothered me was that the HTML for the pages was running 25K alone. I assumed that this was due to the extensive Javascript pop-up menu I am using. Why should my customers have to reload the same script every time?
I did a little digging and found that scripts can be called very easily with a “source=” statement. Mind you I know nothing about Java, the script was written by Fireworks, then imported into the pages by Dreamweaver. So I figured out what part was the script and saved it as a separate .js file. Then I modified the script-loading statement (apparently Javascripts are loaded as an active command, ready to run when the page loads) to call the .js file. The trick was in figuring out how to invoke the .js command, so I did some trial and error and peaking at other codes (my page actually has a second external .js for roll-over buttons).
Net result…I cut 7K off of the page size. They will only need to load the extra .js file once, making the rest of my pages faster. The customer may never know, or notice, but I feel I’ve taken another step in letting them feel that we care about they want and don’t want. And no one wants a slow-loading page. (BTW, saw a sister company’s new website today. Very slow Flash with little payoff. Groan.)
