Using a .js in a .js

Discussion in 'JavaScript' started by donny, Dec 24, 2007.

  1. #1
    Hi,

    I am trying to use the lightwindow script inside my unblockable popup window script. Apparently, it doesn't work. How do I put a .js inside a .js? Simply listing them in my head tags doesn't seem to work

    eg.

    <script type="text/javascript" src="javascript/prototype.js"></script>
    <script type="text/javascript" src="javascript/effects.js"></script>
    <script type="text/javascript" src="javascript/lightwindow.js"></script>

    <script src="dw_lib.js" type="text/javascript"></script>
    <script src="dw_glider.js" type="text/javascript"></script>
    <script src="CounterHandler.js" type="text/javascript"></script>

    Any tips?

    Thank you,
    Donny
     
    donny, Dec 24, 2007 IP
  2. donny

    donny Banned

    Messages:
    890
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ok, so I found out that it's because the two sets of files have variables or functions with the same name. Does anyone know how to fix this problem? It's because there are duplicate variable names. Is there an efficient way to make them different?
     
    donny, Dec 24, 2007 IP
  3. locdev

    locdev Active Member

    Messages:
    171
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #3
    That is a usual problem with frameworks.
    As I know you can only rename vars.
     
    locdev, Dec 25, 2007 IP
  4. clogmoney

    clogmoney Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Multiple functions within 2 js files will cause bad stuff to happen. Unfortunatly you will have to rename
     
    clogmoney, Dec 26, 2007 IP