Re: htmlentities()



On Thu, 28 Feb 2008 15:51:23 +0100, Jerry <Jerry@xxxxxxxxxx> wrote:

The manual says that the default parameter is:

ENT_COMPAT - Will convert double-quotes and leave single-quotes alone.

Why is that the default and not:

ENT_QUOTES - Will convert both double and single quotes.

Because by default, most people use double quotes for their tag attributes rather then single quotes (which are just as valid offcourse). In most circumstances, you don't want both (for instance, setting an onclick attribute on a tag in double quotes: you want the double quotes as entities, converting the single quotes will usually end up destroying the javascript in there.

Also, what does 'ENT' refer to here? Thanks.

ENTities
--
Rik Wasmus
.



Relevant Pages

  • Re: writing parameter dynamically
    ... What is the complete code for the tag in the *.aspx file? ... the way I showed you, even with single quotes, they work perfectly. ... possible that the error is referring to a different server tag. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Regular Expression question
    ... It also fails to match any image tag where the src attribute is quoted ... using single quotes, or where the src attribute is not enclosed in quotes ... Handle all of that correctly in the regex and the beautiful soup or ...
    (comp.lang.python)
  • writing parameter dynamically
    ... How can i write dynamic parameter for a java script function in ... for static usage like; ... I have to use single quotes because the parameter must be string. ... it raises "The server tag is not well formed" error .... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: cant insert javascript call with PHP
    ... as you can see, any javascript is appended to the end of the tag, then ... Maybe if you echo the result of yout image() function then and there... ... Rik Wasmus ...
    (comp.lang.php)
  • Re: Javascript escape & JScript GlobalObject.escape
    ... escape is a url escape and single quotes are legal in urls, ... if your are outputing a javascript literal, ... javascript quoting. ...
    (microsoft.public.dotnet.framework.aspnet)