I have been building a rather complex site, and have several files of functions that are included by the frameset page, in the <head>, with:
[code]
<script language=”javascript” src=”sourcefile1.js”>function descs</script>
<script language=”javascript” src=”sourcefile2.js”>more desc</script>
The files that contain simple (straight? only?) functions load fine, and work fine. I recently tried to add a file with some object-making functions. I wrapped the code in HTML and script tags to test them stand-alone, and they worked fine. ‘new ObjectWhatever()’ created a new object, the methods all worked, etc. So, I removed the markup and script tags, saved it with a .js extension, and included it, just like all the other source files:
[code]
<script language=”javascript” src=”newfile.js”>comments</script>
None of the object functions are accessible in the html pages. I am on Mac OS 10.4, and have tried both Safari and Firefox. The file seems to /load/ fine, the alerts I added verify that, but the code .. just isn’t accessible, apparently.
I did add a non-constructor function to the misbehaving file, and can access it with ‘top.func()’, not func(), but ‘new top.constructor()’ doesn’t work, either.
This is driving me mad. If anyone can point out what I’m doing wrong, I’d be deeply grateful.
If you need the actual code, let me know.
Thanks in advance, just for reading!
cct