這裏是我的<head>
+ <body>
部分:JavaScript的干擾
<script type="text/javascript" src="http://www.septa.org/site/js/jquery-1.4.2.js">
<script type="text/javascript">
function insert(){
var linkElement = document.getElementById("BackButton");
var linkElementLnk = document.getElementById("BackButtonlnk");
var loc_array = document.location.href.split('/');
if (loc_array[loc_array.length-3] == "m")
{
linkElementLnk.style.display = 'none';
}
if (loc_array[loc_array.length-3] == "maps" || loc_array[loc_array.length-2] == "stations" || loc_array[loc_array.length-3] == "stations")
{
linkElementLnk.style.display = 'block';
var newT = document.createTextNode("Stations & Maps");
}
if (loc_array[loc_array.length-2] == "w" || loc_array[loc_array.length-2] == "s" || loc_array[loc_array.length-2] == "h")
{
linkElementLnk.style.display = 'block';
var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-2])));
}
else if (loc_array[loc_array.length-3] != "m")
{
linkElementLnk.style.display = 'block';
if (loc_array[loc_array.length-1] == "index.html" || loc_array[loc_array.length-1] == "index.shtml" || loc_array[loc_array.length-1] == "")
{
var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-3])));
}
else
{
var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-2])));
}
}
linkElement.appendChild(newT);
}
function capWords(str){
var words = str.split(" ");
for (var i=0 ; i < words.length ; i++){
var testwd = words[i];
var firLet = testwd.substr(0,1);
var rest = testwd.substr(1, testwd.length -1)
words[i] = firLet.toUpperCase() + rest
}
return words;
}
</script>
<script type="text/javascript" src="http://www.septa.org/site/js/qTip.js"></script>
<style>
div#qTip {
padding: 3px;
border: 1px solid #666;
border-right-width: 2px;
border-bottom-width: 2px;
display: none;
background: #1c1c1c;
color: #FFF;
font: bold 9px Verdana, Arial, Helvetica, sans-serif;
text-align: left;
position: absolute;
z-index: 1000;
}
</style>
</head>
<body onload="insert();">
當我在我的onload="insert();"
它<body>
保持jQuery的工具提示無法正常工作。任何人都知道這個方法嗎?