Author |
Topic  |
pdrg
Support Moderator
    
United Kingdom
2897 Posts |
Posted - 01 December 2007 : 11:14:33
|
Theoretically one can mix vbscript and javascript in a page, but you'll hit problem after problem trying to retrofit, as javascript isn't at all common running serverside in ASP.
One problem to remember is that ASP is an interpreted language, and the order of the interpretations is always javascript before VBScript (regardless of where on the page they appear), which can badly affect what you expect to happen.
It may make your life a lot easier to rewrite your javascript sections as VBScript. |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 01 December 2007 : 14:29:06
|
First, JavaScript and JScript aren't exactly the same - so which is it?
Second, if you post your JScript, without the @Language statement, between <script language="JScript" runat="server"> </script> tags it will be processed server-side and mix with VBScript - just like I posted earlier. I tried to see if TNX had a "Help" section for developers, but it doesn't look like they have a public one....
Lets take a step back and try to figure out the problem. First, is inc_site_left.asp the only place you are putting the code? |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 01 December 2007 : 20:58:59
|
I would prefer it on inc_site_left, but at this point, I will settle for it anywhere. I am frustrated with TNX and their lack of support and am about to throw the towel in and forget it. |
Cross Tattoos |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 01 December 2007 : 23:56:56
|
It's easy to incorporate javascript in a page that defaults to vbscript
The @Language statement defines the scripting language used for server code between <% .. %> tags. You can use the <script language="javascript" runat="server> ... </script> syntax to define server code in a different scripting language. So a framework would be something like:
<%@LANGUAGE = "VBScript"%>
<%
'vbscript code here
%>
<script language="javascript" runat="server">
// javascript code here
</script>
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 02 December 2007 : 08:08:16
|
quote: Originally posted by MammaRose
I would prefer it on inc_site_left, but at this point, I will settle for it anywhere. I am frustrated with TNX and their lack of support and am about to throw the towel in and forget it.
Is the include for banner1.asp the only thing you have in inc_site_left.asp? |
 |
|
pdrg
Support Moderator
    
United Kingdom
2897 Posts |
Posted - 02 December 2007 : 11:00:06
|
quote: Originally posted by Doug G
<%@LANGUAGE = "VBScript"%>
<%
'vbscript code here
%>
<script language="javascript" runat="server">
// javascript code here
</script>
But don't forget the javascript will still be parsed and evaluated before the vbscript, which can cause problems if you're not expecting it! Just a gotcha, been that way since the 90's but hardly anyone runs up against it as vbscript is the de-facto standard for ASP |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 02 December 2007 : 13:34:58
|
quote: Originally posted by AnonJr Is the include for banner1.asp the only thing you have in inc_site_left.asp?
I have google ads and auctionads running on inc_site_left. I have been putting the TNX code as the first thing on that page. |
Cross Tattoos |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 02 December 2007 : 14:14:10
|
quote: Originally posted by AnonJr
I tried to see if TNX had a "Help" section for developers, but it doesn't look like they have a public one....
They have a help forum but don't tell the site unless you are a member. It is forum.tnx.net I posted my question several times on their forum and have been told by 2 separate moderators that neither of them are asp coders and I would have to wait for their "technical support" to get an answer to my question. |
Cross Tattoos |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 03 December 2007 : 08:59:32
|
If that's the kind of support you can expect, I might reconsider...
That aside, I started digging deeper into why you were getting the "name redefined" error. BITS_TO_A_BYTE and a couple other constants being used by the md5 encryption code are also defined in the SHA256 encryption code used by Snitz. I'd have to look at it more, but there's probably a bit of overlap that can safely be eliminated. That's probably the next step since that was the error you were getting after we fixed the first error.
Its worth noting that we need to be careful with what we edit in these encryption algorithms...  |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 03 December 2007 : 09:38:29
|
Interesting..this is much more complicated than I had first thought. Also, just as a test, I set up a page called test.asp and put nothing but the code to call banner.asp and the page loads as it should.
www.sportsforumz.net/test.asp is the URL
Interestingly, when I use <script language="JScript" runat="server"> on banner1 - I get error
Microsoft JScript runtime error '800a138f'
Object expected
/forum/banner1.asp, line 13 test
but if I use <%@Language="JScript" %> the page loads as it should, but I get the @command error in my forum when I try to include test.asp into inc_site_left.asp |
Cross Tattoos |
Edited by - MammaRose on 03 December 2007 12:59:39 |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 03 December 2007 : 11:02:57
|
Someone else asked for help with ASP on the TNX help forum. So apparently I am not the only one struggling. Is it possible to use another programming language? They also have perl available. |
Cross Tattoos |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 03 December 2007 : 14:11:28
|
quote: Originally posted by MammaRose
Interesting..this is much more complicated than I had first thought. Also, just as a test, I set up a page called test.asp and put nothing but the code to call banner.asp and the page loads as it should.
www.sportsforumz.net/test.asp is the URL
Interestingly, when I use <script language="JScript" runat="server"> on banner1 - I get error
Microsoft JScript runtime error '800a138f'
Object expected
/forum/banner1.asp, line 13 test
but if I use <%@Language="JScript" %> the page loads as it should, but I get the @command error in my forum when I try to include test.asp into inc_site_left.asp
It has to do with the order ASP executes script blocks. Because the MD5 code is in VBScript it doesn't get processed until after the JScript block. It may be worth trying to re-write the JScript code in VBScript.
You get an error on the @Language directive when you include it in the site because Snitz already declares it as VBScript in either inc_header.asp or config.asp - I forget which at the moment.
quote: Originally posted by MammaRose
Someone else asked for help with ASP on the TNX help forum. So apparently I am not the only one struggling. Is it possible to use another programming language? They also have perl available.
You could in the technical sense that its possible, but you're going to run into a lot of the same problems you are now with the order of execution. You would also need to make sure that that particular language is one that is supported on your server. Its looking more and more like you could really use that code in VBScript. I'd ask if they have a VBScript version. |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 03 December 2007 : 16:40:58
|
I will ask TNX, but I would guess that they do not. |
Cross Tattoos |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 04 December 2007 : 09:42:16
|
It may be worth searching their support forums and asking there - I doubt you are the only person to have had these issues. |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 04 December 2007 : 22:29:10
|
Someone else did ask on the help forum, but as far as I can tell, they did not get an answer. I am going to try and get a programmer to help me convert the script. |
Cross Tattoos |
 |
|
Topic  |
|