Hello, I am a self-taught web designer and use HTML, Javascript and PHP. I have written a website for our business which includes an illustrated catalogue. This particular page uses Javascript for linking identical items in various categories, providing larger illustrations in a popup window (self-closing when it loses focus) for some of the items and for creating expanding submenus. The scripts are all in an external file, which is called in the <head>, It works in all browsers as far as I can tell, except for Safari. Talking to one of our customers I found that Safari does interpret all the Javascript that is coded straight into the page's HTML (between <script> tags), but it ignores the whole external file. How can I get it to execute those scripts as well?
In the head is the following code: <script language="javascript" type="text/javascript" src="A7Cscripts.js"></script> Code (markup): Try deleting the language="javascript" part. That's obsolete. <script type="text/javascript" src="A7Cscripts.js"></script> Code (markup):
Thanks, I'll try that. I didn't know that obsolete code would stop something from working -- I thought it would simply be ignored. How do you maintain backward compatitbility (if that's the term I'm looking for -- I'm afraid English is not my native language) if you can no longer use things that have become obsolete but are needed for older browsers? I do no have access to Safari -- if I change this bit of code before posting this message, could someone who uses Safari please go to www.a7c.co.uk/spares.htm and click on "Engine" in the menu on the left? If the external Javascript file works, a submenu should appear. Thanks! PS Does this mean I will also have to remove language="javascript" from every function call, e.g. from <script language="javascript" type="text/javascript">C1_224();</script>
For English not being your native language, you sure seem fluent to me. I'm studying Italian, and I wish I could create sentences like yours. There is no language="javascript" preceding a call to a JavaScript function. None of the underlying code needs to be changed. I would delete the language="javascript" from each of your script tags, whether they include a src or not. Safari probably tends to "enforce" standards more so than IE and other browsers using the Windows platform. I can't imagine that your code is so old that you have to worry about backward compatibility. You mentioned that the code works in most modern browsers. I'd leave it at that and not worry about the three people on the planet who still use Windows 98 and IE5.5.