Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 8 years ago.
Improve this question
I've been looking at this for a long time now, and had several other people look over it. None of whom can spot what's causing this issue.
Something is causing the function validate() to be undefined by the time it gets to the body of the page. I belive there must be some error earlier in the program that is causing the browser to stop processing javascript before then, but I can't find it.
Full JS content:
http://pastebin.com/9b0pwktA
Any insight would be greatly appreciated
I fixed that code (at least visibility of validate method), by removing:
language="text/javascript"
from
<script language="text/javascript">
to make:
<script>
Try that out!
Edit...
There are numerous other bugs, but I targeted the specific problem the question was asking about.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I'm probably doing something obviously wrong, but I just can't see it. I'm trying to use a for loop to define multiple click events and am experiencing an unexpected result. Some of this is working (the hide and show at the beginning of the function, but both sections wind up targeting the second item in the loop. Could somebody take a look at this and tell me what I'm doing wrong? Thank you so much for your help!
here is the link:
http://grana.us/test/expand2.html
You are assigning same event to all summaries for every id. This is wrong...
First... to hide all details and show all toglers simply use:
$('.details').hide();
$('.toggler').show();
And then define click function to all sumaries:
$('.summary').click(function(){
if($('.toggler',this).html() == ' -'){
$('.toggler',this).html(' +');
$('.details',$(this).parent()).hide();
}else{
$('.toggler',this).html(' -');
$('.details',$(this).parent()).show();
}
});
Put everything in...
$(function(){
...
});
and should be ok.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In his video tutorail
http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-day-1/
the author goes to the Codegnitor web site. At first (1:32) the site looks strange (like it did not have any CSS behind it), but when he refreshes it once more the site looks like it should (1:37).
Does anyone know what is the mechanism behind it? I guess that JavaScript calls CSS. Can anyone give me some more details/examples.
Namely I would like to have my site working just like that.
CSS gets activated by 2 possible methods.
Invocation by DOM when the html file is parsed.
Invocation of CSS forcefully by JavaScript's functions.
On this video second method has been used.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I am trying to refresh some div in my website dynamically.
//code changing the source
document.getElementById('#chatbox').src = document.getElementById('#chatbox').src; //refreshes the chatbox
alert("HERE");
The alert() function does not get executed after getElementbyId() is called.
What is going on?
You are trying to access src of undefined as there is probably no element with the id "#chatbox".
Remove the hash and it should work:
document.getElementById('chatbox').src
To debug take a look at your javascript error console or try
alert(document.getElementById('#chatbox')) // undefined
That's because it should be
document.getElementById('chatbox')
Perhaps you are confusing this with jQuery. With jQuery, you would use:
$('#chatbox')
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Improve this question
my site javascript functions normaly work on all browsers except internet explorer 9 , in i7 & ie8 also work normaly.
After a long testing i came to the conclusion that,js file just does not work, but why ?
The interesting thing is that in some cases it works fine, but I do not know in which cases.
After updating the second time is always working properly.
site link is http://calypsoaccessories.com/
remove all console.log from your script
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I am working on a clock which follows an ancient timekeeping at http://ancient-clock.stornge.com.
Right now Chrome has reported an error, but I'm not sure where it's coming from; Chrome says it cannot call a method on undefined, and the error message, in an HTML file containing JavaScript, is not near a line of JavaScript.
How do I identify the root cause when Chrome's debugger is not terribly helpful?
It's at line 20. You have to set a breakpoint to trace where the problem is at. You can even view/change all the variables in the right panel.
As you can see, summer_solstice is not defined.
Currently you are getting an error on the call to ANCIENT_CLOCK.summer_solstice.getTime() as ANCIENT_CLOCK.summer_solstice is not defined anywhere.
You do not have ANCIENT_CLOCK.summer_solstice or ANCIENT_CLOCK.winter_solstice defined.
And you are calling getTime() on both of these inside your ANCIENT_CLOCK.prepare_time function.