Forum Moderators: open

Message Too Old, No Replies

referencing code to another document

need help with long peices of code

         

flying monkey

11:29 pm on Oct 8, 2003 (gmt 0)

10+ Year Member



i have made some buttons in fireworks but teh code is long. is there a way that you can put the code in a doc of some sort and tell the page to look at the doc for the code?

claus

6:40 am on Oct 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you mean javascript, you can put in an external ".js" file and include it like this:

<script type="text/javascript" src="../my-script-file.js"></script>

In this file (my-script-file.js) only write the script, not the <script></script> tags or comments.

/claus

flying monkey

8:18 pm on Oct 9, 2003 (gmt 0)

10+ Year Member



well i have a buch of code that places images on the page. but the code for it is extreamly long. i want to know if there is a way to get the code from another doc.

claus

10:22 pm on Oct 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That is exactly what i wrote in the post above - put it in an js file and include that file using javascript - like the example i posted.

/claus

flying monkey

2:15 am on Oct 11, 2003 (gmt 0)

10+ Year Member



k cool thanks is there another ay to do it besides js

claus

9:55 am on Oct 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh yes, you can include it using server side includes (SSI/shtml) or by using PHP or ASP as well. This is all serverside scripting.

/claus

flying monkey

3:40 pm on Oct 12, 2003 (gmt 0)

10+ Year Member



cool thanks alot it worked great.