SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Where have "Javascript Entities" gone?

    Where have Javascript Entities gone? Was it all too simple then?...did they let to many intruders in, so had to be banished from the language and continued browser support? Were they that bad ? If not! Bring 'em back NOW!!!
    Can someone explain the loss of Javascript Entities as a language feature with full browser support. I know that html attribute values can be dynamically altered via the DOM, DHTML, document.write etc....but to my eyes ... this is elegant and a slick addition!

    Example:
    <script>
    var myImage = "myImage.jpg"
    </script>

    <img src="&{myImage};">

  2. #2

  3. #3
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks for response and the resource link...

    Thanks for response and the resource link, however my question is; Why is this method of accessing javascript global variables no longer supported? It seems like an ideal / logical way to assign dynamic values to html-attributes. Less code, no need to break the flow of coding with <script> tags in the middle of an html document or any other awkward alternatives, and if used properly, seems to retain visual as well as a programmatic logic. I am not advocating replacing any of the current methods, but to merely have it as an additional option. Apparently it was once supported, but has now been deemed obsolete.

  4. #4
    SitePoint Enthusiast Tygatur's Avatar
    Join Date
    Apr 2006
    Location
    Germany
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe because HTML parsers get into trouble if they don't get a valid image resource and entities are not known to them.

    If JavaScript is disabled, it's not a real problem. The site renders to a certain degree and if the designer has done his homework well, it will be still browseable.
    And some Browsers (like on mobiles) may not have JS support at all. Any site with JavaScript Entities may therefore look very strange on these devices.

    Here's a link to the W3C about these JavaScript entities but it's very contradicting, because they call it something that may be a standart in the future but it's deprecated.
    http://www.w3.org/TR/html401/appendi...s.html#h-B.7.1
    to code or not to code ?
    that's too much of a question for a signature.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •