PDA

View Full Version : Include Files


j_wearne
10-28-2002, 12:03 AM
I have a HTML document that is created over three files. The first HTML file calls the second (ASP file) and the second then calls the third (ASP File). Now I have a button that I wish to change using
the onMouseup/onMousedown events but I can only get it to work if the script is called inside the body of the first page. I was wondering if there is any way around this? Some important info about my document is:

The second and third files are only made up of ASP functions and have no HTML, BODY, tags of their own. (to reduce single file size)

If I put the script in either the 2nd or 3rd files (in a function) it works but only if that function is called from the first file (inside the body).

I am a newbie so I am muddling thru here, but I get the feeling I need to do something with the BODY tag.

Any thoughts would be great,

Thanks in advance!

whammy
10-28-2002, 05:27 AM
What exactly are you trying to do (other than include a file in ASP)?

<!-- #include file="test.asp" -->
<!-- #include virtual="/subdirectory/test.asp" -->

If you're going to include files in your FIRST page, (assuming I understood your post), your first page must have an .asp extension as well... not .htm or .html.

:)

j_wearne
10-28-2002, 10:13 PM
I'll try and explain it better. Here goes:

All files are .ASP, and I do know how to call them. I have a javascript which makes a pretty button that uses onMouseup and onMousedown events. Now, the first file calls code in the second to perform a database query. That database code then calls the third file to nicely display the results. This is where I want to put the javascript for the button. The ASP pages work fine, everything gets called when it is supposed to. But if I put the javascript in the third file, it simply doesn't work. Put it in the first file and I have the nice button, working just fine. But of course it is the wrong place on the page.

I don't know much about javascript but I figured that the script had to be called within the BODY HTML tags (but not actually part of the tag), and for all I can see the code should be executed as such.

j_wearne
10-28-2002, 10:39 PM
I figured it out. I was calling the same piece of javascript multiple times to draw several buttons but at the same time, the name of the image remained the same. It was throwing javascript off. I changed my code to dynamically name the button and now the button actually works.

As I said..... I'm a newbie!

Thanks to whammy for the response.



:rolleyes:

whammy
10-28-2002, 11:32 PM
Not sure what the :rolleyes: is about, but I didn't really understand what you were getting at with your first post. Glad you figured it out, though. :)