Home > Net >  Why won't this JavaScript entity work? (specifically: property="&{JavaScript-statements};&
Why won't this JavaScript entity work? (specifically: property="&{JavaScript-statements};&

Time:07-16

I read on a book that "JavaScript entities are values from a script that you use in HTML." I tried copying the code it showed me:

<HTML>
<HEAD><TITLE>Entities Example</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--HIDE
function getWidth(){
  var w = eval(prompt("Enter image width:"))
  return w
}

function getHeight(){
  var h = eval(prompt("Enter image height:"))
  return h
}
//STOP HIDING-->
</SCRIPT></HEAD><BODY>
<CENTER><IMG SRC="gun1.jpg" WIDTH="&{getWidth()};" HEIGHT="&{getHeight()};">
</CENTER></BODY></HTML>

What is expected:
This code is supposed to get the user's answer from a prompt and then return it to set the dimensions of an image.

What resulted:
When I ran the code, I did not get any prompt asking me for any dimensions.

I have already surfed through the web for an answer on this or at least on JavaScript entities but they only show how the code works and the syntax.

CodePudding user response:

JavaScript entities were a feature of Netscape Navigator 3.x that did not achieve widespread support.

You should read a book written this century.

  • Related