Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

errors when I run In my PC but not in the server

Posted on 2013-05-22
5
217 Views
Last Modified: 2013-05-28
Hello I have a web site that when I run inmy pc with visual studio 2010 I get a warning:

"Runtime Error in Microsoft JScript: Can not set value of the property 'className': object is null or undefined"

the code is

           var menuSelected = 5;
               items[menuSelected].className = "selected";

but If I push "continue" the proyect runs fine. And when I upload to the server All works fine.

My problem is that is very disturbing to see this message constantly and have to click to continue
0
Comment
Question by:limmontreefree
  • 2
5 Comments
 
LVL 21

Accepted Solution

by:
Amitkumar Panchal earned 500 total points
ID: 39195078
such errors occur when a java script code is executed on a object which not loaded or initialized. in other words, javascript is started executing before loading the entire webpage.

please check at your end. To check, you can add a timer in the function, so that it can function will execute after some time. generally, javascript function calls are written at the end of web page to avoid such issue.
0
 

Author Comment

by:limmontreefree
ID: 39200420
Thanks I'll try and tell You.
0
 

Author Closing Comment

by:limmontreefree
ID: 39202740
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question