in reply to Re^3: Free Nodelet Hack: Add parent & root links to nodes in 'Nodes You Wrote' (escape)
in thread Have parent 'Node ID' as link in 'Nodes You Wrote' node

root is a URI component, so it could be escaped.

if ( decodeURIComponent(`_redir"`) == "root" )

I've discussed the need for a variables returned as JavaScript literals before. I even provided a workaround.

if ( decodeURIComponent(decodeURIComponent('`_redir%`')) == "root" )
if ( decodeURIComponent( '`_redir%`' ) == "root" )

  • Comment on Re^4: Free Nodelet Hack: Add parent & root links to nodes in 'Nodes You Wrote' (escape)
  • Select or Download Code

Replies are listed 'Best First'.
Re^5: Free Nodelet Hack: Add parent & root links to nodes in 'Nodes You Wrote' (escape)
by tye (Sage) on Dec 22, 2006 at 18:32 UTC

    I'm not sure why you are thinking that it needs to be decoded twice. `_redir` expands to the parameter value, not to how that value might have been escaped in order to get passed through HTTP.

    I was aware of your work-around, which was part of why I was aware that a better solution was warranted. But, with the better solution, decodeURIComponent() would not be required.

    - tye        

      not to how that value might have been escaped in order to get passed

      Of course! I should have tested first :(

      I'm so used to seeing escaping an unescaping not being done when it should, I sometimes assumes it isn't done.