商品详细页面出现这样的错误提示

2016-07-07 15:00 来源:www.chinab4c.com 作者:ecshop专家

Line:31
Char:9
Code:0
Error:'0' 为空或不是对象
网址:http://127.0.0.1/upload/themes/Man/js/action.js

这个是么东西?求解,好心人看看,能否解决掉

回答:
这样的错误,我没有遇到过哦,帮你顶下.

这是遨游浏览器左下角打红×里的内容,在IE8下弹出对话框,也是这个错误

http://127.0.0.1/upload/themes/Man/js/action.js
??????

麻烦你把js代码贴出来一下!
IE报的js错误完全没有参考价值
可以用FF试试!

  1. function $(element) {
  2. return document.getElementById(element);
  3. }
  4. //切屏--是按钮,_v是内容平台,_h是内容库
  5. function reg(str){
  6. var bt=$(str+"_b").getElementsByTagName("h2");
  7. for(var i=0;i<bt.length;i++){
  8. bt[i].subj=str;
  9. bt[i].pai=i;
  10. bt[i].style.cursor="pointer";
  11. bt[i].onclick=function(){
  12. $(this.subj+"_v").innerHTML=$(this.subj+"_h").getElementsByTagName("blockquote")[this.pai].innerHTML;
  13. for(var j=0;j<$(this.subj+"_b").getElementsByTagName("h2").length;j++){
  14. var _bt=$(this.subj+"_b").getElementsByTagName("h2")[j];
  15. var ison=j==this.pai;
  16. _bt.className=(ison?"":"h2bg");
  17. }
  18. }
  19. }
  20. $(str+"_h").className="none";
  21. $(str+"_v").innerHTML=$(str+"_h").getElementsByTagName("blockquote")[0].innerHTML;
  22. }


  23. //goods.dwt
  24. function initAutoFocus(){
  25. autoShiftFocus("focustab", "a", "focuscont", "div");
  26. function autoShiftFocus(tabsid, tabstagname, contentid, contenttagname){
  27. //var autotpc = setInterval(autoSlideTopic, 3000);//每隔3秒运行一次autoSlideTopic
  28. var tabs = document.getElementById(tabsid).getElementsByTagName(tabstagname);//提取a标签
  29. tabs[0].className = "act";
  30. var contents = document.getElementById(contentid).getElementsByTagName(contenttagname);//提取id为focuscont下的div标签
  31. contents[0].style.display = "block";
  32. var cur_index_num = 0;
  33. if (tabstagname == "a") {
  34. for (var a = tabs.length - 1; a >= 0; a--) {
  35. tabs[a].onclick = function(){
  36. return false;
  37. }
  38. }
  39. }
  40. function getContentsArr(){
  41. var contentsarr = new Array();
  42. for (var z=0;z<contents.length; z++) {
  43. if(contents[z].id.indexOf(contentid)>=0){
  44. contentsarr[contentsarr.length] = contents[z];
  45. }
  46. }
  47. return contentsarr;
  48. }
  49. var contarr=getContentsArr();
  50. function autoSlideTopic(){
  51. for (var a = tabs.length - 1; a >= 0; a--) {
  52. tabs[a].className = "";
  53. }

  54. for (var b = contarr.length - 1; b >= 0; b--) {
  55. contarr[b].style.display = "none";
  56. }
  57. contarr[cur_index_num].style.display = "block";

  58. tabs[cur_index_num].className = "act";
  59. var total_num = tabs.length;
  60. cur_index_num++;
  61. if (cur_index_num >= total_num) {
  62. cur_index_num = 0;
  63. }
  64. }
  65. for (var c = tabs.length - 1; c >= 0; c--) {
  66. tabs[c].onmouseover = function(){
  67. //clearInterval(autotpc);
  68. changeTabs(this.name);
  69. }
  70. tabs[c].onmouseout = function(){
  71. //autotpc = setInterval(autoSlideTopic, 3000);
  72. clearInterval(autoSlideTopic);
  73. }
  74. }
  75. function changeTabs(num){
  76. var thenum = num - 1;
  77. for (var n = tabs.length - 1; n >= 0; n--) {
  78. tabs[n].className = "";
  79. }
  80. tabs[thenum].className = "act";
  81. for (var m = contarr.length - 1; m >= 0; m--) {
  82. contarr[m].style.display = "none";
  83. }
  84. contarr[thenum].style.display = "block";
  85. cur_index_num = thenum;
  86. }

  87. }

  88. }

  89. function elems(id,cur){
  90. var id = document.getElementById(id).getElementsByTagName("li");
  91. for(var i=0; i<id.length; i++)
  92. {
  93. id[0].className = "cur";
  94. id[i].onmouseover = function()
  95. {
  96. this.className="";
  97. for(var j=0; j<id.length; j++)
  98. {
  99. if((id[j].getAttribute("class") == cur) || (id[j].getAttribute("className") == cur))
  100. {
  101. id[j].className = "";
  102. break;
  103. }
  104. }
  105. this.className = cur;
  106. }
  107. }
  108. }
复制代码

这个是该页面的文件

LZ一定修改了 模板导致JS的部分函数找不到对象!

是的,我修改了,现在不知道我错在那里了,郁闷的很啊

帮你顶一下!

不错 很强大