Wayne Barron
asked on
ASP inside JavaScript (runat=Server)
Hello All;
How do I get this to work?
If keeps giving me an error on the "Article"
Microsoft JScript compilation error '800a03ed'
Expected '('
/Test.asp, line 203
if getType="Article" then
----------------^
Thanks All;
Carrzkiss
How do I get this to work?
<%if getType="Article" then%>
case '[ct':return '<tr><th class="wikibox">Article Views</th><td class="wikibox">'+artHits+'</td></tr>';
<%elseif getAdmin="EditArticle" then%>
case '[ct':return '<tr><th class="wikibox">Article Views</th><td class="wikibox">Hits Generated</td></tr>';
<%end if%>
If keeps giving me an error on the "Article"
Microsoft JScript compilation error '800a03ed'
Expected '('
/Test.asp, line 203
if getType="Article" then
----------------^
Thanks All;
Carrzkiss
ASKER
I am using VBScript, but have a JS code that is runat:Server
So, not really sure what would need to be used within it.
I have done the following
Microsoft JScript compilation error '800a03ea'
Syntax error
/Test.asp, line 204
So, not really sure what would need to be used within it.
I have done the following
<%if (getType=="Article") then%>
case '[ct':return '<tr><th class="wikibox">Article Views</th><td class="wikibox">'+artHits+'</td></tr>';
<%elseif (getAdmin=="EditArticle") then%>
case '[ct':return '<tr><th class="wikibox">Article Views</th><td class="wikibox">Hits Generated</td></tr>';
<%end if%>
And when run, I get an error on the <%Microsoft JScript compilation error '800a03ea'
Syntax error
/Test.asp, line 204
ASKER
Removing the <% and %>
from the code, I get an error on the
else if
Microsoft JScript compilation error '800a03ea'
Syntax error
/Test.asp, line 206
else if (getAdmin=="EditArticle") then
^
Also.
I would need to end the statement, but it does not seem like the
end if
is going to work, or does it?
from the code, I get an error on the
else if
if (getType=="Article") then
case '[ct':return '<tr><th class="wikibox">Article Views</th><td class="wikibox">'+artHits+'</td></tr>';
else if (getAdmin=="EditArticle") then
case '[ct':return '<tr><th class="wikibox">Article Views</th><td class="wikibox">Hits Generated</td></tr>';
end if
Microsoft JScript compilation error '800a03ea'
Syntax error
/Test.asp, line 206
else if (getAdmin=="EditArticle") then
^
Also.
I would need to end the statement, but it does not seem like the
end if
is going to work, or does it?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I took my code and did what I new how to do, I used my vbscript at the top of the page outside of the JS code, and then called the Variable inside of it code.
Works like expected, should have done this to begin with.
Thanks pateljitu for you trying to help.
Carrzkiss
Works like expected, should have done this to begin with.
Thanks pateljitu for you trying to help.
Carrzkiss
<%if (getType=="Article") then%>