Howdy_McGee Posted September 15, 2010 Share Posted September 15, 2010 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 More sharing options...
jeffman Posted September 15, 2010 Share Posted September 15, 2010 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 More sharing options...
Howdy_McGee Posted September 16, 2010 Author Share Posted September 16, 2010 So how would I call it in my HTML file if I just want to pull the value of 1 variable in the function?document.get(myFunction(variable))? Link to comment Share on other sites More sharing options...
jeffman Posted September 16, 2010 Share Posted September 16, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.