Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript not executing

Status
Not open for further replies.

CJason

Programmer
Oct 13, 2004
223
US
I am having an issue where it appears that nothing is getting "executed" outside the <% %>. I can even put junk there...nothing happens. I guess I don't really care about the "junk" scenario...what I'm simply trying to do is a javascript "alert". It works on the main .asp script, but when I attempt it in a .asp script that is initiated from a button action (html), I get nothing. Any ideas?
 
some code would help.

do you realize that your ASP basically is a program that outputs HTML.

so in order to debug you could write what you want in HTML, and test it. If it works, then you know what your ASP program must deliver.
 
Yep, I realize that. I was just hoping that someone would have run into something similiar to this, and could respond with a simple "Oh, yes...this happened to me and this is how I resolved it". I guess I'll keep testing myself, unless others have an idea.
 
Here is some snippets of code that I "hope" explain my issue.

Generated HTML (paraphrasing)
Code:
<form name="thisisit" action="doit.asp" method="post">

doit.asp
Code:
<%@ Language=VBScript%>
<script language="javascript">
alert("Output this!")
</script>

The problem is that "Output this!" never pops up.

Thanks for any help you can give!
 
>alert("Output this!")
[tt]window.onload=function() {alert("Output this!")};[/tt]
 
doit.asp:
Code:
<script language="javascript">alert("Output this!")</script>


or put put it in a function and use it eg:
like this
<body onload={functionname}>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top