Jump to content

Entities In Javascript (html) Dom


compositor
 Share

Recommended Posts

Is what possible about entities in JavaScript and HTML DOM?Entities are part of the HTML layer, so you can safely write

var string = "This & that";

As far as writing entities in JavaScript sensetive places, I'm not entirely sure about the story... nor am I sure if it's the same on all browsers. i.e.

if (this > that)

may work (and is actually guaranteed to work in XHTML served as application/xhtml+xml), but that's not to be taken for granted. If you want to be on the safe side, write all of your JavaScript in an external file.

Edited by boen_robot
Link to comment
Share on other sites

Is what possible about entities in JavaScript and HTML DOM?Entities are part of the HTML layer, so you can safely write
var string "This & that";

As far as writing entities in JavaScript sensetive places, I'm not entirely sure about the story... nor am I sure if it's the same on all browsers. i.e.

if (this > that)

may work (and is actually guaranteed to work in XHTML served as application/xhtml+xml), but that's not to be taken for granted. If you want to be on the safe side, write all of your JavaScript in an external file.

Hi Boen,I looked into it, and actually you need to use programming contructs, eg C and Java. I was wondering since w3 schools have no information on this maybe i should post a link, since using hex references is the only way.Thank you
Link to comment
Share on other sites

Err, a "programming construct" is any feature of a programming language, e.g. conditionals, arithmetic, looping.An "entity" (as we understand it) is a character sequence in HTML, beginning with an ampersand, that represent some other character, e.g.  .A "hex reference" is either an assembly opcode, or more relevant to web design, a hexadecimal representation of a color in the RGB color space.In other words, I don't think we understand what you are asking.

Edited by Synook
Link to comment
Share on other sites

Err, a "programming construct" is any feature of a programming language, e.g. conditionals, arithmetic, looping.An "entity" (as we understand it) is a character sequence in HTML, beginning with an ampersand, that represent some other character, e.g.  .A "hex reference" is either an assembly opcode, or more relevant to web design, a hexadecimal representation of a color in the RGB color space.In other words, I don't think we understand what you are asking.
This is what I found:http://www.fileformat.info/info/unicode/char/feff/index.htmYou can use the C/C++/Java source code reference.Does anyone know if it's on the w3schools website?Thank you
Link to comment
Share on other sites

What exactly are you trying to do? Are you trying to represent a Unicode character in the HTML DOM? I'm not even really sure what that means.. if you're using Javascript or HTML and you want to represent a unicode character, you can use either entity code listed on that page (either decimal or hex). Is that what you're trying to do? What's your question?

Link to comment
Share on other sites

That link doesn't load for me, but unless you are trying to display supplementary characters (Unicode codepoints that require 21 bits) a HTML entity will suffice.

Link to comment
Share on other sites

That link doesn't load for me, but unless you are trying to display supplementary characters (Unicode codepoints that require 21 bits) a HTML entity will suffice.
Hi,As far as I know Unicode entities in DOM aren't replaced with their representation but are rather left "as is" and the only way to represent a character in a codified fashion is by using programming entities instead, this makes sense as you cannot use classes either.By DOM I mean using programmatic means to render a webpage, eg via javascript.Anyway, that link should work if you copy and paste manually.Thank you
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...