Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

You should read a book written this century.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading