JScript Problems with ASP

They have: 7 posts

Joined: Feb 2001

Hi,

I've got a site that uses both VBScript and JScript. In all the pages is included a footer via server-side include. In that footer is code, but since we don't know what the calling page is using, we're enclosing the code in:
<script language="JavaScript" runat=server>
</script>

That's all fine and good, and the code runs, BUT, the output from the page is like this:

blah blah blah
jscript file included here at the end, using several Response.Write("BLAH"); calls, but before /body and /html are written... Except, keep reading...

RESULTS FROM JSCRIPT FILE BEING DISPLAYED HERE...

What's up with that? The best I can figure, all code is being run on the server, then HTML string produced, THEN the jscript is being run and appended to the end. Any thoughts?

If that didn't make sense what is happening, let me know and I'll try to explain it more. My question is, WHY is it doing that, and HOW do I get it to put the results from the code where it should belong?

THANKS!!!

you rang???

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

hmmmm.... I've never seen that.

what is the extension on the calling page? is it ASP also?

I've never tried to include an ASP page into anything other than another ASP page. That said, try makeing the calling page ASP as well, then try including again. Let me know if that fixes it.

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 7 posts

Joined: Feb 2001

Yeah, the calling page has a .asp extension, and it is including a .asp extension (actually we tried re-naming the included page to a bunch of stuff... but I'm pretty sure that doesn't matter)

We got around it though, we just made 2 versions of the included file, one in JScript, one in VBScript, then included the appropriate page depending on what language it was written in. Messy I know, but it works! Thanks!

you rang???

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.