Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

external javascript  RSS feed

 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks the answers to 1 and 2 answered everything, and i am just so confused i am going to sleep on it
 
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


type and src are attributes, not content.



Eric
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Eric,
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!