This problem has nothing to do with Visual Studio.
Apparently, you did not define the function
prompt
. But why?
Your whole approach to the calculator is already wrong. JavaScript calculator is a really simple thing. Everything is already done for you in JavaScript itself.
You should never prompts anything, ever. Instead, you should have a Web page with some standard controls.
Provide a text area element for the user to put any JavaScript expressions. It could be virtually any JavaScript code valid in any context. The, one some event (for example, on some button), you should get the property
value
of this control and call JavaScript function
eval(string)
with this value:
http://www.w3schools.com/jsref/jsref_eval.asp[
^].
Then you should output result somewhere.
Look at the example on the page referenced above. No, you should not required the user to write any output like
document.write
. You should have some variable calculating result of evaluation and show the result in some other HTML element.
—SA