在FF3中工作时,IE8中的对象未定义错误

问题描述 投票:0回答:1

我将这个外部JS文件包含在网页中。它是一个绝对定位的页脚工具栏,具有切换视图功能。它在FF3中完美运行。但IE8给错误'animatedcollapse'是未定的,它只是悬挂在页面的底部。你能搞清楚这里缺少什么吗?

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>");
javascript internet-explorer-8 undefined
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.