•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 429,992 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,429 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 712 | Replies: 2 | Solved
![]() |
•
•
Join Date: Jul 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
This is the weirdest problem I've seen so far. But upfront this is my first javascript development. I've mostly programmed in Actionscript and PHP.
I have quite a bit of javascript running on my PHP page. I had just gotten everything to work well (looking at you IE7!) and I moved one function to another place because out of the blue I was getting "function is not defined."
From there everything went wrong. Soon the page wouldn't register any functions. I moved it all to an external .js file and that solved nothing.
So I went back to where it all went wrong. One by one as I used the page I would get an undefined function error. So I moved these one by one to a different part of the page. Soon I was able to get all the code working but I had my leftover <script> tags.
So I deleted this and lo and behold, the page stopped working completely again. So I put it back in and it worked!
As I said I haven't done any real Javascript before so I don't really know the nuances of the page structure concerning the scripting environment. But this seems like a very very odd issue.
But it's one of those "how the hell did I ever figure that out."
In case someone is bored and wants to figure this out I've attached the code. I wouldn't mind knowing (for future reference) why in the world this is happening.
I have quite a bit of javascript running on my PHP page. I had just gotten everything to work well (looking at you IE7!) and I moved one function to another place because out of the blue I was getting "function is not defined."
From there everything went wrong. Soon the page wouldn't register any functions. I moved it all to an external .js file and that solved nothing.
So I went back to where it all went wrong. One by one as I used the page I would get an undefined function error. So I moved these one by one to a different part of the page. Soon I was able to get all the code working but I had my leftover <script> tags.
<link href="css/main.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jsTrace-uc.js"/>
<script type="text/javascript" src="js/dom-drag.js"/>
<script type="text/javascript">
</script>
<script type="text/javascript">
function listHide(boxid){
document.getElementById(boxid).style.visibility = "hidden";
document.getElementById(boxid).style.display = "none";
}
...So I deleted this and lo and behold, the page stopped working completely again. So I put it back in and it worked!
As I said I haven't done any real Javascript before so I don't really know the nuances of the page structure concerning the scripting environment. But this seems like a very very odd issue.
But it's one of those "how the hell did I ever figure that out."
In case someone is bored and wants to figure this out I've attached the code. I wouldn't mind knowing (for future reference) why in the world this is happening.
•
•
Join Date: Apr 2005
Location: New York state
Posts: 468
Reputation:
Rep Power: 5
Solved Threads: 72
•
•
Join Date: Jul 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks! I was just thinking about that this morning. I've been looking at the JS for the problem I just looked it right over.
But those tags have been like that since I put them in and only in the past two days did I get the 'function is not defined' error.
But thanks again. I knew it was something stupidly simple.
But those tags have been like that since I put them in and only in the past two days did I get the 'function is not defined' error.
But thanks again. I knew it was something stupidly simple.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: JQuery Accordion Menu (Help Needed)
- Next Thread: prototype.js/window.js close "Window" from iframe?


Linear Mode