2009-10-27 39 views
0

我有這個外部JS文件包含在一個網頁中。它是一個絕對定位的頁腳工具欄,具有切換視圖功能。它在FF3中非常完美。但IE8給出了錯誤'animatedcollapse'未定義,它只是掛在頁面的底部。你能否找出這裏缺少的東西?對象在IE8中未定義的錯誤

document.write("<link href=\"css\/catfish.css\" rel=\"stylesheet\" media=\"screen\">"); 
document.write("<script type=\"text\/javascript\" src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.3.2\/jquery.min.js\"><\/script>"); 
document.write("<script type=\"text\/javascript\" src=\"js\/animatedcollapse.js\"><\/script>"); 
document.write("<script type=\"text\/javascript\">"); 
document.write("animatedcollapse.addDiv('catfish', 'fade=0,speed=400,group=pets,hide=0');"); 
document.write("animatedcollapse.ontoggle=function($, divobj, state){};"); 
document.write("animatedcollapse.init();"); 
document.write("<\/script> "); 
document.write("<div id=\"catfish_wrap\">"); 
document.write(" <div id=\"btn_toggle\"><a href=\"#\" style=\"border:0px;\" rel=\"toggle[catfish]\" data-openimage=\"images\/collapse.png\" data-closedimage=\"images\/expand.png\"><img src=\"images\/collapse.png\" border=\"0\" \/><\/a><\/div>"); 
document.write(" <div id=\"catfish\">"); 
document.write("  <div id=\"sub_form\">"); 
document.write("    <form name=\"subscribe_newsletter\" id=\"subscribe_newsletter\">"); 
document.write("     <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"); 
document.write("      <tr>"); 
document.write("      <td width=\"58%\"><h3>Subscribe me to your fantastic newsletter<\/h3>"); 
document.write("        <input name=\"fullname\" onClick=\"select()\" class=\"txtBox\" id=\"fullname\" value=\"Enter Full Name!\">"); 
document.write("        &nbsp;&nbsp;&nbsp;&nbsp;<input name=\"email\" onClick=\"select()\" class=\"txtBox\" id=\"email\" value=\"Valid E-mail Address!\">"); 
document.write("        <\/td>"); 
document.write("      <td width=\"42%\" align=\"right\"><input type=\"image\" src=\"images\/btn_subscribe.png\" style=\"padding-top:8px;\" value=\"Subscribe Newsletter\"><\/td>"); 
document.write("      <\/tr>"); 
document.write("     <\/table>   "); 
document.write("    <\/form>"); 
document.write("  <\/div>"); 
document.write(" <\/div>"); 
document.write(" "); 
document.write("<\/div>"); 
+0

請包括其中的animatedCollapse變量實例化animatedcollapse.js – Jason 2009-10-27 23:16:21

+0

源?它看起來像你試圖.addDiv從你發佈的東西不存在的東西。 – wambotron 2009-10-28 00:37:18

+0

@Jason animatedcollapse.js代碼如下。 @Sea Hag如果.addDiv不存在如何在Firefox中完美工作。我不認爲火狐能夠很好地對自己的朋友做得很好:) http://bit.ly/1wpB8T – nomidesigns 2009-10-28 02:43:00

回答

相關問題