Email conversation
From | Pierre Nyst |
To | Me |
Subject | Using a .js file for your Perfect Popups script |
Date | 9 March 2010 15:24 |
Hi,
first of all, thank you for your scripts, that's a great job !
As you can see I use your popup javascript
(http://www.howtocreate.co.uk/perfectPopups.html) for my website
([URL]) about my cattery of
ragdolls. I have tested it with miscellaneous browsers (Firefox, Opera,
Konqueror, Chrome, IE, ...), and it works very well.
As I use this script in more than one html page, it should be better to
write it in a .js file (e.g. PerfectPopup.js), to put the statement <SCRIPT
SRC="PerfectPopup.js" type="text/javascript"
language="JavaScript1.2"></SCRIPT> in each page. Unfortunately it doesn't
work: instead of a popup I have a new tab (or window, depending on the
browser). What can I do to have it work ?
Sorry for my bad English, my native language is French ...
Thanks in advance
Pierre
From | Me |
To | Pierre Nyst |
Subject | Re: Using a .js file for your Perfect Popups script |
Date | 13 March 2010 13:16 |
Pierre,
You have changed the valid JavaScript comments:
//kinda important
to HTML comments, which do not belong in JavaScript:
<!-- kinda important -->
Put them back as they should be.
You also added several of your own using this incorrect syntax, and those
will also need to be changed to use correct JavaScript comment syntax.
The script should work in an external script file. Copy everything from
inside the <script>...</script> tags, and put it in an external script file
(foo.js or whatever), then change the script tag to point to it:
<script src="foo.js">...</script>
It should then just work.
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Pierre Nyst |
To | Me |
Subject | Re: Using a .js file for your Perfect Popups script |
Date | 13 March 2010 19:52 |
Fantastic Mark, it works !
Thanks a lot !
Pierre