PDA

View Full Version : Insert into <head>....



Nile
02-01-2009, 02:54 AM
1) Script Title: Simple Controls Gallery, Smooth Navigational Menu (v1.01), Animated Collapse Div.

More though...

2) Script URL (on DD):
http://dynamicdrive.com/dynamicindex4/simplegallery.htm (http://dynamicdrive.com/dynamicindex4/simplegallery.htm)
http://dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm (http://dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm)
http://dynamicdrive.com/dynamicindex17/animatedcollapse.htm (http://dynamicdrive.com/dynamicindex17/animatedcollapse.htm)

3) Describe problem:
Some scripts, including the ones listed above say:


Step 1: Insert the following code into the <head> section of your page:


Which I recently noticed wouldn't be valid. If you had a page such as:


<html>
<head>
<title>My Profile!</title>

</head>
<body>
<p>Content... Content.... Content...</p>
</body>
</html>

Some beginner might go along and do something like this(using Smooth Navigational Menu):


<html>
<head>
<title>My Profile!</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<link rel="stylesheet" type="text/css" href="ddsmoothmenu.css" />

<!--[if lte IE 7]>
<style type="text/css">
html .ddsmoothmenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]-->

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="ddsmoothmenu.js">

/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
</head>
<body>
<p>Content... Content.... Content...</p>
<div id="smoothmenu1" class="ddsmoothmenu">
<ul>
<li><a href="http://www.dynamicdrive.com">Item 1</a></li>
<li><a href="#">Folder 0</a>
<ul>
<li><a href="#">Sub Item 1.1</a></li>
<li><a href="#">Sub Item 1.2</a></li>
<li><a href="#">Sub Item 1.3</a></li>
<li><a href="#">Sub Item 1.4</a></li>
<li><a href="#">Sub Item 1.2</a></li>
<li><a href="#">Sub Item 1.3</a></li>
<li><a href="#">Sub Item 1.4</a></li>
</ul>
</li>
<li><a href="#">Folder 1</a>
<ul>
<li><a href="#">Sub Item 1.1</a></li>
<li><a href="#">Sub Item 1.2</a></li>
<li><a href="#">Sub Item 1.3</a></li>
<li><a href="#">Sub Item 1.4</a></li>
<li><a href="#">Sub Item 1.2</a></li>
<li><a href="#">Sub Item 1.3</a></li>
<li><a href="#">Sub Item 1.4</a></li>
</ul>
</li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Folder 2</a>
<ul>
<li><a href="#">Sub Item 2.1</a></li>
<li><a href="#">Folder 2.1</a>
<ul>
<li><a href="#">Sub Item 2.1.1</a></li>
<li><a href="#">Sub Item 2.1.2</a></li>
<li><a href="#">Folder 3.1.1</a>
<ul>
<li><a href="#">Sub Item 3.1.1.1</a></li>
<li><a href="#">Sub Item 3.1.1.2</a></li>
<li><a href="#">Sub Item 3.1.1.3</a></li>
<li><a href="#">Sub Item 3.1.1.4</a></li>
<li><a href="#">Sub Item 3.1.1.5</a></li>
</ul>
</li>
<li><a href="#">Sub Item 2.1.4</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="http://www.dynamicdrive.com/style/">Item 4</a></li>
</ul>
<br style="clear: left" />
</div>
</body>
</html>


I guess it's not that big of an issue... Just reporting it just in case. :D

Snookerman
02-01-2009, 06:45 PM
I've also thought about that, I suppose the doctype is there because some scripts only work with certain doctypes. A better approach would be to have a separate text box containing only the doctype and a specification that the user must use that doctype in order to get the script working. Since there is no specification that the user must use a certain doctype, they might just take the script and paste in on their page and it might not work because the have a different doctype. (I gotta stop saying "doctype")