code in external file

Discussion in 'JavaScript' started by roice, Oct 29, 2010.

  1. #1
    Hello,
    I found script for lightbox-
    http://www.sohtanaka.com/web-design/examples/modal-window/

    I want to take the code that inside the <script type="text/javascript">.....</script> tags (the one that start with "$(document).ready(function(){", and put it inside new file call "lightbox.js", and than call this file with this code:
    <script type="text/javascript" src="lightbox/lightbox.js"></script>

    I did it but for some reason, when I take the code out of the " <script type="text/javascript">....</script> " tag and put it in other file, the script doesn't work.

    Should I change anything in the script for that?

    Thank you in advance.
     
    roice, Oct 29, 2010 IP