When to use “client-side routing” or “server-side routing”?

tl;dr: with server-side routing you download an entire new webpage whenever you click on a link, with client-side routing the webapp downloads, processes and displays new data for you. Imagine the user clicking on a simple link: <a href=”https://stackoverflow.com/hello”>Hello!</a> On a webapp that uses server side routing: The browser detects that the user has clicked … Read more

Client-side “Feature Tour” (tutorial/instructional) overlay system? [closed]

Thanks to Johnson for giving me a good term to Google with (sans ridiculous false positives). Here is a list of “feature tour” solutions I’ve found: Joyride | http://zurb.com/playground/jquery-joyride-feature-tour-plugin Intro.js | http://usablica.github.io/intro.js/ Hopscotch | http://linkedin.github.io/hopscotch/ Crumble | http://blog.tommoor.com/crumble/ Pageguide | http://tracelytics.github.io/pageguide/ Bootstro.js | http://clu3.github.io/bootstro.js/ I’m sure there are more out there. These solutions can make … Read more

Why does page not update after refresh when .cshtml changes

After Asp.net Core 3.0, Runtime compilation is enabled using the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package. To enable runtime compilation, apps must: Install the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package. Update the project’s Startup.ConfigureServices method to include a call to AddRazorRuntimeCompilation: services .AddControllersWithViews() .AddRazorRuntimeCompilation(); or services.AddMvc().AddRazorRuntimeCompilation();

Sending emails with Javascript

The way I’m doing it now is basically like this: The HTML: <textarea id=”myText”> Lorem ipsum… </textarea> <button onclick=”sendMail(); return false”>Send</button> The Javascript: function sendMail() { var link = “mailto:me@example.com” + “?cc=myCCaddress@example.com” + “&subject=” + encodeURIComponent(“This is my subject”) + “&body=” + encodeURIComponent(document.getElementById(‘myText’).value) ; window.location.href = link; } This, surprisingly, works rather well. The only … Read more

Best practice for localization and globalization of strings and labels [closed]

As far as I know, there’s a good library called localeplanet for Localization and Internationalization in JavaScript. Furthermore, I think it’s native and has no dependencies to other libraries (e.g. jQuery) Here’s the website of library: http://www.localeplanet.com/ Also look at this article by Mozilla, you can find very good method and algorithms for client-side translation: … Read more

Getting query parameters from react-router hash fragment

Note: Copy / Pasted from comment. Be sure to like the original post! Writing in es6 and using react 0.14.6 / react-router 2.0.0-rc5. I use this command to lookup the query params in my components: this.props.location.query It creates a hash of all available query params in the url. Update: For React-Router v4, see this answer. … Read more

AngularJS: Understanding design pattern

Thanks to a huge amount of valuable sources I’ve got some general recommendations for implementing components in AngularJS apps: Controller Controller should be just an interlayer between model and view. Try to make it as thin as possible. It is highly recommended to avoid business logic in controller. It should be moved to model. Controller … Read more

Image resizing client-side with JavaScript before upload to the server

Here’s a gist which does this: https://gist.github.com/dcollien/312bce1270a5f511bf4a (an es6 version, and a .js version which can be included in a script tag) You can use it as follows: <input type=”file” id=”select”> <img id=”preview”> <script> document.getElementById(‘select’).onchange = function(evt) { ImageTools.resize(this.files[0], { width: 320, // maximum width height: 240 // maximum height }, function(blob, didItResize) { // … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)