4 ms·
> - Troubleshooting a bug in a site, view source.... and see SQL in the JS. this is why I refuse to do "View Source" on the HealthCare.gov website. I'm afraid
by mkramlich 13y ago
> - Troubleshooting a bug in a site, view source.... and see SQL in the JS.
this is why I refuse to do "View Source" on the HealthCare.gov website. I'm afraid of what I might see.
- aaronem 13y agoI'm just gonna leave this right here: if ('en' === 'en') { $('#desktop-nav .middle').append('<a class="liteac-login topnav myprofile" href="/marketplace/auth/global/en_US/myProfile#landingPage">My Profile</a>'); $('.mobile-nav-right').append('<a class="mobile-right-bottom liteac-login" href="/marketplace/auth/global/en_US/myProfile#landingPage">My Profile</a>'); } else { $('#desktop-nav .middle').append('<a class="liteac-login topnav myprofile" href="/marketplace/auth/global/es_MX/myProfile#landingPage">My Profile</a>'); $('.mobile-nav-right').append('<a class="mobile-right-bottom liteac-login" href="/marketplace/auth/global/es_MX/myProfile#landingPage">My Profile</a>'); }
- illicium 13y agoAh, now I see why it has 500 million lines of source code.
- mkramlich 13y agoand costs 200M$+ because, you know, static HTML and some CRUD/lookup logic behind-the-scenes is just that hard
- DCoder 13y agoSeen this pattern many times before. One of those 'en' strings is the current user's language being written into the source, the other is hardcoded. If your server-side templating engine is impotent and only supports variable interpolation without conditionals, this approach is easier than pulling the right JS snippet from somewhere else.