Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 66491
160
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: 66491
160
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,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!