Is not possible you put the JS
directly connected at the ASP
then forget using it as part of logic because the way the ASP
and the JS
are processed is different, ie if you try to put your function JS
as a condition for a repeat loop or even a simple conditional(IF
) it will not work because the ASP
is interpreted by server and only then on the side of client the JS
will be sued.
But it is possible that you include the call to a function JS
within an element HTML
, as long as you have the script with function in the document is it a JS
external included or not.
So off the if(MINHA_FUNÇÂO_JS_AQUI)
that definitely won’t work
another problem in your code is that you concatenated the excerpt from JS
in the element HTML
wrongly:
<%= "<img src='onClick='javascript:abrirNegociacaoTipoAtendimento();' />" %>
the correct would be:
<%= "<img onClick='javascript:abrirNegociacaoTipoAtendimento();' />" %>
Or
<%= "<img onClick=""javascript:abrirNegociacaoTipoAtendimento();"" />" %>
This code will be interpreted by the server and will create the following HTML
:
<img onclick="javascript:abrirNegociacaoTipoAtendimento();" />
I made a comment on the goal, about downvote and I’m getting downvotes without even deserving, that is, out of pure hatred, but I’m still going to continue with my opinion about these guys here. They’re hiding, some cowards.
– pnet
Certainly it is a problem of Stackoverflow. It has the link of the topic, I want to follow!
– Paulo Sérgio Duff
I think the negative votes of this question are coming because it has no code or exemplification of what you want (which I don’t think is a reason to vote negative). And yes, it’s a real problem...
– LocalHost
But think about me. It’s a very general question, I don’t see why have a code. Like I said, I have an Asp page and I need to call a js function, but I’ll take one of the many times that this will happen, I’ll block the code.
– pnet
This is not possible.
– Diego Souza
It was not I who denied it. But I agree with you. Vote negative, does not say why and nobody edits.
– Diego Souza
The platform itself gives a "reminder" to consider a comment while negative. It is common for me to see some downvotes and no comments. I wonder if, in our reality, it would not be necessary to force a comment to use downvote, unfortunately.
– BrTkCa
vote up, clear and objective question, is that it is fashionable to give downvote.. rs
– Dorathoto