Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Sign up or Login to participate.
|
|||||||
Begin your free trial now
Pay-as-you-go options starting at $10/user/month
Pay-as-you-go options starting at $10/user/month
Does anybody here know javascript? Odd function problem
|
|
Thread Tools | Search this Thread |
|
#1
|
||||
|
||||
|
Does anybody here know javascript? Odd function problem
Hey, I usually have other forums for programming, but since I like it here, I figured I'd give my fellow members a shot at it. Let me summarize my code, see if you can tell me why I'm having the issue. Here is a mock up, simplistic java function:
Quote:
Note that in the for loop, I use NO break or continue statements. In the for loop I have a while loop and one IF statement. That's it. But when the FOR loop ends, I can't do anything else in code. What's up with that? I know the for loop and sub code works just fine, as I've monitored it and the output is perfect. But when the loop comes to an end, apparently so does all other code in the function. Any ideas? |
|
#2
|
|||
|
|||
|
Your code seems fine, but is anything actually calling the function?
Is this code in the HEAD or BODY of the page? It doesn't matter too much, but I personally put it in the head. If it is in the body and there are no parameters, you don't really need the function test() { and last }. It should just execute. But if you prefer to have that, call the function. Easiest way would be just before the close script tag, put on a new line test(); unless you want it called at a specific point. Hope that helps
|
|
#3
|
||||
|
||||
|
I finally found the problem and it had to do with an inner WHILE loop, my counter was going out of bounds and throwing an error on the while condition check.
IE actually helped with this, as it gives you the java error, which I never noticed because I was using Avant. Oh well, the issue is resolved. Thanks for the thought. |
![]() |
| Similar Topics | ||||
| Topic | Replies | Forum | ||
Problem with IF function
|
0 | Windows OS | ||
Javascript problem?
|
13 | Virus and Malware Removal | ||
Problem with Dell Keyboard Function
|
0 | Device Drivers | ||
Problem with JavaScript/Flash 8
|
1 | Software Apps | ||
Thumbnail (javascript) problem - help plz!
|
0 | Windows OS | ||
| Thread Tools | Search this Thread |
|
|
All times are GMT -4. The time now is 02:46 PM.



Problem with IF function