Simple clear advice in plain English

Hands on: Office on the web

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:

somewhere.else/
search.php” target=”_blank”
onClick=”self.close()”>
searchreminder.png”
alt=”Search this site” width=”200”
height=”150” border=”0”>

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:

Reader Comments

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Hard disk illustration

How to buy upgrades that are compatible with your computer

Upgrading parts of your computer, such as hard disks, graphics cards and memory, is easy as long as you research exactly what you need

USB connection to a laptop

Set up an external hard disk and free up space on your computer

If you're short of space on your hard disk, there's a quick and easy solution

smashing-wordpress-themes

Smashing Wordpress Themes: Making Wordpress Beautiful - book review

An in-depth guide to editing and creating Wordpress themes

Question & Answer

Q.Why are some of the keys on my keyboard doing strange...

> Read the answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Best deals on the web

img

Samsung RV520-A07

£359.98- Buy it now

img

Acer Aspire 5750G (LX.RXP02.019)

£399.99- Buy it now

img

Apple MacBook Pro (MD313B/A)

£904.37- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

Restore point

A Windows backup of system files and settings.

Great shopping deals from Computeractive