Jump to content

Variables


Howdy_McGee

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?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...