Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Create And Import JavaScript Modules For A Large Script
vizskywalker
post May 21 2006, 04:15 AM
Post #1


Techno-Necromancer
Group Icon

Group: Members
Posts: 1,018
Joined: 13-January 05
From: The Net
Member No.: 2,127



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:[code=HTML]<head>
<script type="text/javascript" src="/foo/mainbar.js"></script>
<script type="text/javascript" src="/foo/modulebar.js"></script>
</head>[/code]
Javascript code snippet:[code=Javascript]import Object.functionName;
[/code]
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
Go to the top of the page
 
+Quote Post
iGuest
post Mar 16 2008, 10:36 AM
Post #2


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



An alternate javascript import for web applications
Create And Import JavaScript Modules For A Large Script

Why not try out owl import at http://code.Google.Com/p/owlimport/.

An alternate way of import javascript and managing your javascript dependencies.

-reply by mark forster
Go to the top of the page
 
+Quote Post
iGuest
post May 14 2008, 11:30 AM
Post #3


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Getting Screen Resolution using Javascript.(8)
  2. How To Create A Popup Window With Javascript?(19)
  3. javascript vs java(12)
  4. Javascript: Disable Mouse Right-click In Browser(16)
  5. Best Way To Learn Javascript(9)
  6. Javascript: Text To Texbox And Back To Text(2)
  7. Browser Quaker Script - Shock Your Visitors!(5)
  8. Dynamicdrive: Good Site For JavaScript Codes(5)
  9. Javascript: Simple Slidedown Menu(2)
  10. JavaScript: Simple Dropdown Menu(1)
  11. JavaScript: Hide And Show Any Element With CSS(5)
  12. Ever Needs To Find Out A Table Height Or With With JavaScript(2)
  13. Vertical Marquee Using JavaScript(0)
  14. JavaScript Frames & Querystring(4)
  15. JavaScript Off Redirect Script(2)
  1. Enlarge Image Script(19)
  2. I Need Help With Javascript.(7)
  3. Problems With Dynamically Loading Javascript(2)
  4. One Click To Copy Script(0)
  5. Add Text To Textarea(6)
  6. Javascript Question(4)
  7. Javascript: How Do I Create Embedded Pop-up Windows?(7)
  8. Problem With Javascript Alert();(9)
  9. Include Function For Javascript(7)
  10. Fun With Javascript And Forms(2)
  11. Javascript Help Needed : Alert(z) Works Fine But Document.write Not(2)
  12. Javascript Changes Aren't Working.(6)
  13. Love Script(3)


 



- Lo-Fi Version Time is now: 8th September 2008 - 04:46 AM