0

i wonder if calling asp classic function from a javascript function is allowed.

like this one.

function asp(asp)

....do task

end function

Then ......

function javascript(java)
{
bConsultant = alert('<%=asp("'+ java +'")%>');
}
SyntaxError
  • 3,717
  • 6
  • 30
  • 31
  • possible duplicate of [How to call code behind server method from a client side javascript function?](http://stackoverflow.com/questions/5828803/how-to-call-code-behind-server-method-from-a-client-side-javascript-function) – JJJ Aug 01 '12 at 09:35
  • Hi,thanks for sharing but the samples indicated there are asp.net codes. i need the asp classic code for this.thanks – SyntaxError Aug 01 '12 at 09:43
  • I'm guessing this is related to your previous question, in which case please delete that previous question since it can no longer help you or anyone else. – AnthonyWJones Aug 01 '12 at 09:56
  • To do this, you need to call it via an ajax call – Graham Aug 01 '12 at 16:25

1 Answers1

0

You cannot call a classic-asp function from javascript. classic-asp is a server side scripting language and javascript is a client side one. So simply it is defined where to run which codes or functions.
You can do it by ajax but it is not actually calling a function. Its just calling the whole page in classic asp which has already been run in the server

polin
  • 2,745
  • 2
  • 15
  • 20