Currently, I have the script on every page in the web site. Is there some way to put the script in a file in a subfolder and just link to it in each web page?
Here is the link to the site I'm testing now:
http://www.upctraining.rccomputersolutions.biz/
Here is the code I'm using in each page:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(function() {
$("<select />").appendTo("nav");
$("<option />",
{
"selected": "selected",
"value" : "",
"text" : "Site Menu" // default <option> to display in dropdown
}).appendTo("nav select");
$("nav a").each(function()
{
var el = $(this);
// my changes start
if(el.parents(".submenu").length) {
$("<option />", {
"value" : el.attr("href"),
"text" : "-- " + el.text()
}).appendTo("nav select");
} else {
$("<option />", {
"value" : el.attr("href"),
"text" : el.text()
}).appendTo("nav select");
}
});
$("nav select").change(function()
{
window.location = $(this).find("option:selected").val();
}); });
</script>
<script>
$(function() {
$("<select />").appendTo("nav");
$("<option />",
{
"selected": "selected",
"value" : "",
"text" : "Site Menu" // default <option> to display in dropdown
}).appendTo("nav select");
$("nav a").each(function()
{
var el = $(this);
// my changes start
if(el.parents(".submenu").length) {
$("<option />", {
"value" : el.attr("href"),
"text" : "-- " + el.text()
}).appendTo("nav select");
} else {
$("<option />", {
"value" : el.attr("href"),
"text" : el.text()
}).appendTo("nav select");
}
});
$("nav select").change(function()
{
window.location = $(this).find("option:selected").val();
}); });
</script>
I would like to use something like I use for links to the style sheets.
Is that possible and if so, how is it done?
Thanks