• TS (unregistered)
    /****************
    *  Easy reader version:
    *  #####################
    *  # Easy Reader Version
    *  # // Easy Reader Version
    *  # // ' Easy Reader Version
    *  # // ' REM Easy Reader Version
    *  #####################
    *****************/
    -->```
    
  • Dennis (unregistered)

    Seems a bit like the average Wordpress plugin. And I can't even say that I've done much better myself, just seems to be the standard, terrible, WP way.

  • Tim R (unregistered)

    This type of approach is par for the course in any environment where you've got server-side and client-side script going on (i.e. most web apps). The best (only?) way to avoid it is to use a framework that lets you use the same language on both client and server e.g. nextjs or blazor

  • (nodebb)

    some JavaScript code that modifies a CSS class

    No it doesn't. It adds a CSS class to some HTML elements.

  • (nodebb) in reply to TS

    Bravo.

  • Robin (unregistered) in reply to Tim R

    You do realise that there's absolutely no need to have Javascript for this at all? It's just statically adding an HTML class at load time, based on some state on the server - that both can and should be handled entirely on the server side to build the appropriate HTML either with or without the class.

  • (author) in reply to Tim R

    No, do not do this, even if you're using the same language on both sides. The HTTP request is a natural module boundary, do not cross that boundary except through a well defined interface, for example, an XMLHttpRequest. If you really need to pass parameters from the server side to the client side in the document, serialize the parameters to JSON and embed it as a variable, e.g. let _serverSideParams = <% toJson(myDictionary) %>;.

  • Quinn (unregistered) in reply to TS

    "I mean, if you're working in LISP, 90% of your program is going to be macros"

    Even in lisp the rule is to only use a macro when you really need to. At least in scheme, common lisp and clojure writing a macro when a function would suffice is a big no-no

  • Scragar (unregistered)

    The PHP code embeds an HTML tag

    a HTML tag

  • Argle (unregistered) in reply to Scragar
    Comment held for moderation.
  • (nodebb) in reply to Scragar

    Someone flunked Pedantic Grammar 101 . Yes, 'an' before 'h' is gramatically correct usage. Most of the time nobody cares.

  • Conradus (unregistered) in reply to Scragar
    Comment held for moderation.
  • Tim R (unregistered) in reply to Remy Porter
    Comment held for moderation.
  • (nodebb) in reply to cellocgw
    Someone flunked Pedantic Grammar 101 . Yes, 'an' before 'h' is gramatically correct usage. Most of the time nobody cares.

    And to be even more pedantic the reason for this is because 'h' makes an 'a' sound when pronounced and since you use 'an' before vowel sounds this is why it's "an HTML tag".

  • (nodebb) in reply to Scragar

    An aitch tee emm ell tag. So yes, "an HTML tag" is correct. Sheesh.

  • (nodebb) in reply to cellocgw

    Yes, 'an' before 'h' is gramatically correct usage.

    No. "An hotel", "an herb", "an hero", etc. are not correct usage.

  • Lurk (unregistered) in reply to Steve_The_Cynic

    "An hotel" is a correct usage in the UK. It is rather old fashioned, but it is correct.

  • Argle (unregistered) in reply to Steve_The_Cynic
    Comment held for moderation.
  • Brian Boorman (unregistered) in reply to Steve_The_Cynic
    Comment held for moderation.
  • SomeGuyOnTheInternet (unregistered) in reply to Steve_The_Cynic
    Comment held for moderation.
  • NotAThingThatHappens (unregistered) in reply to Steve_The_Cynic

    The French are famous for not pronouncing a 'starting h'. In English/American the 'h' is also sometimes supressed/silenced. Case in point "herbs" can be pronounces as 'erbs. (uurbs) I have never heard anybody pronounce "HTML" as 'MTL (um tee el)

    Language is messy.

  • Officer Johnny Holzkopf (unregistered)
    Comment held for moderation.
  • Simon (unregistered) in reply to Lurk
    Comment held for moderation.
  • Duke of New York (unregistered)
    Comment held for moderation.
  • (nodebb) in reply to NotAThingThatHappens
    Comment held for moderation.
  • Elijah (unregistered)
    Comment held for moderation.
  • i (unregistered) in reply to NotAThingThatHappens
    Comment held for moderation.
  • Nicholas (unregistered)
    Comment held for moderation.

Leave a comment on “Metaception”

Log In or post as a guest

Replying to comment #:

« Return to Article