Jump to content

Variables


Howdy_McGee
 Share

Recommended Posts

Is it possible to access and show in an HTML page the values for variables that are in function which are also in a external .JS file?I'm also having trouble having my forum access my javascript that is in an external file.I have my form as

onSubmit="return validate(this)"

but it isn't running through my javascript validation, do I need to be more specific like onSubmit return="Validation.validate(this)" Or something so that it knows to go to that .JS file?

Edited by Howdy_McGee
Link to comment
Share on other sites

Every global object (variables, functions) in every script in your document of linked to your document should be available everywhere. No matter how many documents, there is only one global space. So you should be able to call a function in an external script without doing anything special.Something else might be wrong.

Link to comment
Share on other sites

I think you're making this more complicated than it really is. Just call the function normally:myFunction(variable)That should do it. If the function isn't running correctly, then maybe the function has a problem. Have you tested this in Firefox to see if the Error Console reports any errors? That's a good place to start.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...