More basic Javascript, plus some Office tips for web developers and designers
So, especially if you’re using odd symbols, it’s always worth checking out what an Office-generated web page will look like on a Mac as well as a PC – and if it’s something you can’t change easily, such as a complicated spreadsheet, then you might want to consider turning it into a PDF that can be downloaded rather than a standalone web page.
None of this, of course, suggests you should never use Office to make web pages. But it’s better suited to quick, simple tasks, rather than bigger, more complicated sites.
How to create your own Javascript pop-ups
A lot of people find pop-ups annoying, and their indiscriminate use is certainly
irritating, but they can also have their place – highlighting new features on a
site perhaps, or important news. On one of my sites, I used a pop-up to promote
a new site-wide search feature, with an image that, when clicked, opened the
search page in a new window and closed the pop-up at the same time.
The pop-up box itself is just a simple HTML file, with the image centred and a link to the target page, with an extra bit of Javascript to close the pop-up too – ‘self.close’ does pretty much what you’d expect the command to do:
So, how about making the message pop up in the first place? We need two things – a Javascript function that will open a new window and a call to it. And since we want the pop-up to appear when the body of our web page loads, we specify it in the BODY tag, like this:
”noticeWindow()”>where noticeWindow is the name we’ll give to the function we write to pop up the window. That can either be in the main web file, as inline Javascript, or if you want to refer to it from other pages, you might include it, for example via PHP like this:
(‘sitefunctions.js’); ?>
The actual Javascript looks like this:
Related articles
Q.Why are some of the keys on my keyboard doing strange...
Q.Is my phone’s Bluetooth any use?
Q.Can I switch boot drives so that I can work on older...
Old Street roundabout is being touted by the Government as the UK's answer to Silicon Valley, but it seems our best innovations are coming from all over the UK
|
|
|
|
|
Computeractive Excel (2010) Online tutorialPrice: £19.99 |
Computeractive Word (2010) Online TutorialPrice: £19.99 |
Computeractive Powerpoint (2010) Online TutorialPrice: £19.99 |
Angry BirdsPrice: £9.99 |
Back Issue CD-Rom 14 (2011)Price: £15.99 |