| Author |
external javascript
|
Wendy Gibbons
Bartender
Joined: Oct 21, 2008
Posts: 1098
|
|
ok with all your help i got my javascript working, but i have 3 maybe more pages that will use the same methods
so i made sure i wasn't using any of the html global variables (except document).
and this works until...
i cut the script and put it in a seperate file, now it no longer works
i haven't posted the file as i want general advice not specific answers, i learn better that way.
thank you
changed my mind here is an example that isn't working now:
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
Does your file contain the <script> tags? If so, remove them.
i haven't posted the file as i want general advice not specific answers, i learn better that way.
But if you make people guess as to what your problem is you will find that most people will simply start to ignore your posts.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Wendy Gibbons
Bartender
Joined: Oct 21, 2008
Posts: 1098
|
|
sorry that was so vauge, i have narrowed my thoughts down to a few questions (i was about to delete my 1st post when you answered):
1. are parameters in javascript passed by value or reference? i am guessing value
2. is the .js script just inserted into the html file like a macro between the <script></script> tags?
3. i have a global variable in my .js file does it keep the value between calls to functions? if the answer to question 2 is no
4, if the answer to 1 is value and 2 and 3 are no, do i have to return the new updated value to continue using it
5, can i use the document variable in my .js?
these are all the possible causes i can think of for the problem, and i am trying to work it out myself.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
|
|
Wendy Gibbons wrote:1. are parameters in javascript passed by value or reference? i am guessing value
Since there's no such thing as a pointer...
2. is the .js script just inserted into the html file like a macro between the <script></script> tags?
Any JS imported into the page is indistinguishable from script included in the page itself.
3. i have a global variable in my .js file does it keep the value between calls to functions? if the answer to question 2 is no
See 2.
4, if the answer to 1 is value and 2 and 3 are no, do i have to return the new updated value to continue using it
I have no idea what you are asking.
5, can i use the document variable in my .js?
See 2.
|
 |
Wendy Gibbons
Bartender
Joined: Oct 21, 2008
Posts: 1098
|
|
|
thanks the answers to 1 and 2 answered everything, and i am just so confused i am going to sleep on it
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
|
|
type and src are attributes, not content.
Eric
|
 |
Wendy Gibbons
Bartender
Joined: Oct 21, 2008
Posts: 1098
|
|
|
thanks Eric,
|
 |
 |
|
|
subject: external javascript
|
|
|