Jump to content
xisto Community
vizskywalker

Create And Import JavaScript Modules For A Large Script

Recommended Posts

I have one main script which defines an object. I then have several other script files that define functions for that object. I have tried using the following setup to import the functions:
HTML code snippet:

<head><script type="text/javascript" src="/foo/mainbar.js"></script><script type="text/javascript" src="/foo/modulebar.js"></script></head>
Javascript code snippet:
import Object.functionName;
This works fine for Mozilla Firefox, but causes an error in Internet Explorer which causes the object to be undefined. I would like to know how better to import the functions into the main javascript (preferably without needing to add the module script to the html file) that works in both Firefox and Internet Explorer.

Thank you,
~Viz

Share this post


Link to post
Share on other sites

how to import javascript ?

Create And Import JavaScript Modules For A Large Script

 

I have created login page (login.Htm) containing username textbox and password textbox.I want to validate username nad password but, also don't want to write script in same (login.Htm) file. I have written script for validation in another validate.Js file and called it in login.Htm but it's not working. Can anybody help me out?

 

-question by rahul patil

Share this post


Link to post
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

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.