-1

我的 Javascript 和 PHP 日历(可在“选择日期”按钮下访问:http: //xenon.colorado.edu/portal/index.php ?product=snow&dyndate=true )在 IE8 下无法运行,但在 FF 和 Chrome 中运行良好.

IE 在 calendar.js 的第 13 行抛出错误:

document.getElementById(objname+'_frame').contentWindow.adjustContainer();


ERROR MSG: Object doesn't support this property or method
Line: 13
Char: 5
Code: 0
URI: http://xenon.colorado.edu/portal/calendar/calendar.js

任何帮助将不胜感激。谢谢!

编辑:这个页面似乎暗示它可能与函数名称和 onclick 调用有关?http://www.javascriptjunkie.com/?p=12有什么想法吗?

4

2 回答 2

0

从你的 body 标签中移除对 GUnload() 的调用。这是来自现已弃用的 API V2,但您正在加载 API V3。

<body class="" onload="load()" onunload="GUnload()">

编辑:

此外,在第 91 行还有一个额外的逗号:

icon: 'images/Dyn2.png',
shadow: circleshadow,
    //zindex: 0,
    hover: 'images/Dyn1.png'
 }, //<------------------------Remove this comma on line 91.
于 2012-09-20T14:36:20.863 回答
0

弄清楚了。我有一个 IFrame,它的网址是:

http://xenon.colorado.edu/portal/calendar/calendar_form.php?objname=date1&selected_day=1&selected_month=1&selected_year=2012&year_start=2010&year_end=2012&dp=1&da1=1290236400&da2=1338184800&sna=1&aut=&frm=&tar=&inp=f˚FY'DIS = PR1 = PR2&=&PRV =&PTH =日历/&SPD = [[1290409200,1291705200,1291618800,1293087600,1290754800,1293346800,1292137200,1291791600,1293174000,1291186800,1290582000,1290236400,1292310000,1291359600,1292482800,1290927600,1293519600 ,1292828400,1293606000,1291878000,1293433200,1290495600,1292655600,1291100400,1291964400,1292742000,1292050800,1293778800,1290668400,1290322800,1292396400,1291273200,1291532400,1293001200,1292569200,1290841200,1291446000,1292914800,1293692400,1293260400,1292223600,1291014000 ,1298098800,1321945200,1303452000,1299222000,1303711200,1301032800,1302501600,1323241200,1299394800,1323154800,1320300000,1300600800,1302328800,1302588000,1296370800,1297234800,1296802800,1299308400,1301983200,1300341600,1324623600,1295593200,1302760800,1296975600,1304143200 ,1320649200,1294383600,1320213600,1296198000,1301119200,1296630000,1300773600,1296889200,1297926000,1301464800,1322290800,1294815600,1320994800,1324882800,1323673200,1298617200,1320386400,1320735600,1298530800,1298703600,1323327600,1297062000,1299567600,1301551200,1299913200,1324710000,1297753200,1303884000,1304488800, 1299049200,1296457200,1322722800,1320472800,1300428000,1322118000,1302069600,1321772400,1301378400,1297321200,1323846000,1298271600,1301292000,1322895600,1298444400,1303192800,1297839600,1324018800,1322463600,1295938800,1325055600,1321513200,1294988400,1301896800,1324364400, 1321254000,1325142000,1302933600,1298962800,1323414000,1301205600,1324969200,1322031600,1294642800,1303538400,1294297200,1298185200,1324191600,1295420400,1294210800,1321167600,1298358000,1322636400,1294902000,1301637600,1296025200,1320559200,1295247600,1294470000,1323500400, 1324278000,1299654000,1323586800,1297407600,1325314800,1302156000,1294038000,1322204400,1317967200,1303279200,1320908400,1300687200,1321599600,1295074800,1299135600,1298876400,1299826800,1303624800,1321858800,1323932400,1304316000,1295766000,1321340400,1296716400,1301724000,1293951600,1299740400,1300082400, 1295506800,1296284400,1296111600,1304229600,1322809200,1295161200,1294729200,1299481200,1293865200,1297580400,1300514400,1302415200,1323068400,1295334000,1303797600,1298790000,1324537200,1300860000,1303106400,1302674400,1297494000,1321426800,1303020000,1295679600,1297666800, 1302847200,1300946400,1324105200,1322377200,1322982000,1298012400,1321081200,1301810400,1319695200,1303970400,1294556400,1324450800,1325228400,1294124400,1295852400,1324796400,1299999600,1296543600,1303365600,1300168800,1320822000,1323759600,1321686000,1297148400,1300255200, 1322550000,1329634800,1336284000,1335074400,1330498800,1330844400,1335333600,1332655200,1334124000,1331017200,1338184800,1332223200,1333951200,1334210400,1327906800,1328770800,1328338800,1330930800,1333605600,1331964000,1327129200,1334383200,1328511600,1335765600,1325919600,1327734000,1332741600,1325401200, 1328166000,1332396000,1328425200,1329462000,1333087200,1337925600,1326351600,1330153200,1330066800,1330239600,1336197600,1328598000,1331190000,1333173600,1331532000,1329289200,1335506400,1336111200,1330671600,1327993200,1332050400,1333692000,1333000800,1328857200,1329807600, 1332914400,1329980400,1334815200,1329375600,1327474800,1335679200,1326524400,1333519200,1334556000,1330585200,1332828000,1326178800,1335160800,1325833200,1329721200,1326956400,1325746800,1329894000,1326438000,1336024800,1333260000,1327561200,1333864800,1326783600,1326006000, 1331276400,1328943600,1333778400,1325574000,1336370400,1334901600,1332309600,1326610800,1330758000,1330412400,1331449200,1335247200,1335938400,1327302000,1338098400,1328252400,1333346400,1325487600,1336543200,1331362800,1331704800,1327042800,1327820400,1327647600,1335852000,1326697200,1326265200,1331103600, 1329116400,1332136800,1334037600,1326870000,1335420000,1330326000,1332482400,1334728800,1334296800,1329030000,1334642400,1327215600,1329202800,1336456800,1334469600,1332568800,1329548400,1333432800,1335592800,1326092400,1325660400,1327388400,1331618400,1328079600,1334988000, 1331791200,1328684400,1331877600],[],[]]&spt=1&och=phpCal%28%29&str=0&rtl=0&wks=&int=1&hid=1&hdt=1000&hl=en_US1336543200,1331362800,1331704800,1327042800,1327820400,1327647600,1335852000,1326697200,1326265200,1331103600,1329116400,1332136800,1334037600,1326870000,1335420000,1330326000,1332482400,1334728800,1334296800,1329030000,1334642400,1327215600,1329202800,1336456800,1334469600, 1332568800,1329548400,1333432800,1335592800,1326092400,1325660400,1327388400,1331618400,1328079600,1334988000,1331791200,1328684400,1331877600],[],[]]&SPT = 1&OCH = phpCal%28%29&STR = 0&RTL = 0&周= INT = 1&HID =1&hdt=1000&hl=zh_CN1336543200,1331362800,1331704800,1327042800,1327820400,1327647600,1335852000,1326697200,1326265200,1331103600,1329116400,1332136800,1334037600,1326870000,1335420000,1330326000,1332482400,1334728800,1334296800,1329030000,1334642400,1327215600,1329202800,1336456800,1334469600, 1332568800,1329548400,1333432800,1335592800,1326092400,1325660400,1327388400,1331618400,1328079600,1334988000,1331791200,1328684400,1331877600],[],[]]&SPT = 1&OCH = phpCal%28%29&STR = 0&RTL = 0&周= INT = 1&HID =1&hdt=1000&hl=zh_CN1325660400,1327388,1328079600,1334988000,1331791200,1328684400,1331877600,1331877600,1331877600]和SPT = 1&Och = PHPCAL%28%29&RTR = 0&RTL = 0&WKS = 1&HID = 1&HDT = 1000&HL = EN_US1325660400,1327388,1328079600,1334988000,1331791200,1328684400,1331877600,1331877600,1331877600]和SPT = 1&Och = PHPCAL%28%29&RTR = 0&RTL = 0&WKS = 1&HID = 1&HDT = 1000&HL = EN_US

那是4282个字符。IE 的 src 属性的最大长度为 2,083 个字符。因此带有日期选择器的 iframe 仍然为空.. 所以我必须解决这个问题......

于 2012-09-21T00:18:01.363 回答