Disable links in UIWebView?

You can give the UIWebView a delegate and implement the -webView:shouldStartLoadWithRequest:navigationType: delegate method to return NO; (except on the initial load). That will prevent the user from viewing anything but that single page. To provide an example requested in the comments… Start with allowLoad=YES and then: – (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { return allowLoad; } – … 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

Passing values through React-Router v4

Passing props You can pass arbitrary props to a route via the state object: <Link to={{ pathname: ‘/route’, state: { foo: ‘bar’} }}>My route</Link> Then you can access the state object from within your component: const {foo} = props.location.state console.log(foo) // “bar” Passing parameters Configure your route path to accept named parameters (:id): <Route path=”/route/:id” … Read more

How to convert an address into a Google Maps Link (NOT MAP)

How about this? https://maps.google.com/?q=1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003 https://maps.google.com/?q=term If you have lat-long then use below URL https://maps.google.com/?ll=latitude,longitude Example: maps.google.com/?ll=38.882147,-76.99017 UPDATE As of year 2017, Google now has an official way to create cross-platform Google Maps URLs: https://developers.google.com/maps/documentation/urls/guide You can use links like https://www.google.com/maps/search/?api=1&query=1200%20Pennsylvania%20Ave%20SE%2C%20Washington%2C%20District%20of%20Columbia%2C%2020003

Preg_match_all

Simple PHP HTML Dom Parser example: // Create DOM from string $html = str_get_html($links); //or $html = file_get_html(‘www.example.com’); foreach($html->find(‘a’) as $link) { echo $link->href . ‘<br />’; }

chart.js – link to other page when click on specific section in chart

You can use getElementAtEvent() method to detect which section/slice of your pie chart was clicked on, and based on that open a link/page accordingly. Here is a quick example : var canvasP = document.getElementById(“pieChart”); var ctxP = canvasP.getContext(‘2d’); var myPieChart = new Chart(ctxP, { type: ‘pie’, data: { labels: [“Värde 1”, “Värde 2”, “Värde 3”, … Read more