Link inside a button not working in Firefox

This doesn’t work because it is not allowed by HTML5: Content model: Phrasing content, but there must be no interactive content descendant. Interactive content means any of the following elements: a audio (if the controls attribute is present) button details embed iframe img (if the usemap attribute is present) input (if the type attribute is … Read more

How to debug React Router?

You can wrap your Router with a DebugRouter which will print the navigation actions made: import React, { Component } from ‘react’; import { BrowserRouter, Route, Switch } from ‘react-router-dom’; import Login from ‘components/Login’ import DefaultComponent from ‘components/DefaultComponent’ class DebugRouter extends BrowserRouter { constructor(props){ super(props); console.log(‘initial history is: ‘, JSON.stringify(this.history, null,2)) this.history.listen((location, action)=>{ console.log( `The … Read more

CSS – style a link based on its “rel” attribute?

Felix Kling and thirtydot suggested to use the [att=val] attribute selector (a[rel=”external”]). But this will only work if external is the only rel value. If you want to style links that could have 1 or more rel values, you should use the [att~=val] attribute selector: a[rel~=”external”] (note the tilde character) An example for such a … Read more

How to create hyperlinks linked to javascript functions in Chrome’s console.log?

The Google Chrome console, like many other browser’s developer tools consoles, automatically parses any URL into a link to that exact page. This is the only way of obtaining such URLs, and, unfortunately, you cannot actually log “custom URLs”. This means that the following logs will be turned into a clickable link automatically: console.log(‘http://example.com’); console.log(‘www.example.com’); … Read more

Add mime type to HTML link

Time to answer my own question. This is a really old question and it probably wasn’t possible at the time but lots has changed since then. The HTML5 spec added the download attribute: <a href=”https://stackoverflow.com/questions/2110269/hugepdf.pdf” download>Download file</a> This will do exactly what I need, tell the browser to download the file instead of opening it. … Read more

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