a href not working with a bare web page - ruby

I've been looking around for a solution to the problem I'm having, but it seems that none of the solutions on SO address my issue.
I was having the dreaded issue where the a href tag in my HTML does not actually take me to the link. At first, I tried removing the JavaScript includes, wondering if something in the JavaScript portion was messing up the page.
Then I removed the CSS portion as well, and ultimately removed everything until the page consisted of simply the header information for the HTML page and only the a href tag. I also changed the link to a non-existent page (to force a 404 error).
When clicking on the link, it keeps me on the current page and doesn't take me to the referenced page (or even give me a 404 error). Following is the stripped out code (everything but the commented out portion):
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>test</title>
<meta name="description" content="test1" />
<meta name="keywords" content="test2" />
</head>
<a href="test.html">Support</a/>
</html>
Thanks for the help.
I made the changes based on the answers given but still see the same behavior. As seen in the screenshot (sorry SO doesn't let me insert images), the URL shows /test.html but the page is still the main page. I changed the text of the link to ensure that the changes were applied.
I'm using rackup to quickly view the changes locally.
Screenshot
Updated code:
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>test</title>
<meta name="description" content="test1" />
<meta name="keywords" content="test2" />
</head>
<body>
Support2
</body>
</html>

Working and tested:
NOTE: Both files [ current one and test.html ] are in same directory.
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>test</title>
<meta name="description" content="test1" />
<meta name="keywords" content="test2" />
</head>
<body>
Support
</body>
</html>
Also test code is working fine using target="_blank" in anchor tag , which open link in new page if working fine, like below:
<a href="test.html" target="_blank" > support </a>

You have an extra slash in your closing a tag.
Should be
</a>.
I would also make sure they are in the same directory.

Apparently the answer was here:
How to setup URLs for static site with Ruby Rack on Heroku
Individual pages were being routed to "/" all the time. Needed to modify "config.ru" to get routing to work properly.
Next step is to look into "sinatra".

Related

Open graph not working, but showing "Redirecting to https://"

I am getting a lot of pain with a small issue. My application https://mokapen.com is SSL certified and I added all open graph code:
<meta property="og:title" content="this is my title" />
<meta property="og:description" content="this is my description" />
<meta property="og:url" content="https://mokapen.com/" />
<meta property="og:image" content="https://mokapen.com/image/cover-open-graph.jpg" />
But the strange behavior is that in Facebook the https://mokapen.com/it is showing error title "Redirecting to https://mokapen.com" and no image.
Do you think is an issue of Laravel Localization or htaccess?
Many thanks of any help!!
Your url has static value. Change url value with current url value
<meta property="og:url" content="{{ url()->full() }}" />
Ps: different laravel version has different url helpers

How do you reset the HTML cache in macOS Mail?

I'm developing an app that sends HTML mail. I just condensed all of my CSS code into a .css file that is now linked in the mail header:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://example.com/mycss.css" rel="stylesheet">
</head>
<body class="email-body">
...etc...
I discovered a mistake in the .css file, re-uploaded it to example.com, and now for the life of me I can't get Mail to use it properly. Mail must still have the old .css file cached.
I know with Safari I can clear the cache with the Safari -> Clear History menu item. How do I do this in Mail?

How to get my site using UTF-8 (PHP site)

First time poster and hoping to solve a very frustrating issue.
In Google chrome, my PHP site displays random characters such as Â. However, when I switch the encoding to UTF-8 all the random characters clear up.
I've been reading elsewhere that that I need to tell me site to use UTF-8 by default. My host say this is already enabled on their side.
What code do I add and where to solve this issue?
Put:
<meta http-equiv='content-type' content='text/html; charset=utf-8'/>
In the <head> of the document, and it should force the page to render utf-8 characters properly.
Further description: In your HTML page, you would have the page layed out as such:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta http-equiv='content-type' content='text/html; charset=utf-8'/>
<!--<link> tags for any CSS-->
<!--<script> tags for any JS-->
<!--Anything else in the head-->
</head>
<body>
<!--Page contents-->
</body>
</html>

Custom image like button on facebook doesn't work

When I want to share a site on facebook and want to add a custom image it doesn't work. It always gives the same image (one that is somewhere on the web page).
This is the code I've used:
<html>
<head>
<meta property="og:title" content="Title" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.the-website.com" />
<meta property="og:image" content="http://url-to-image.com" />
<meta property="og:site_name" content="The content" />
</head>
<body>
<h1> Facebook Like </h1>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.the-website.com%2F&send=false&layout=button_count&width=450&show_faces=true&action=like&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
</body>
</html>
If you try running the page through Facebook linter - http://developers.facebook.com/tools/lint/ - it may show up some issue.
Did you read it ? http://developers.facebook.com/docs/reference/plugins/like/
There is a "code generator" which would do all coding for you. Try it, then copy&paste the code...
As for your code:
- in this case - to have a like on a page - there is no meta needed (your example's meta are not needed).
- you have probably something wrong inside src tag: my guess is to REMOVE the "font&" part, but this might be wrong...
In any case... just use the link I provided...
I had the same problem. What I did was, I just removed the entire line " <meta property="og:image" content="xxxxxxx" /> " . This will push the facebook crawler to scan for every images in the page. Now place the image you want to add somewhere in the page with width=1 and height=1. Users won't recognise this in your page. But this image will be scanned by the crawler and you can select it to show it on our page. This worked for me. I don't know whether it will work for you or not.
NB: This is just a workaround, not a good solution

BlackBerry browser caching even with no-cache meta tags

Okay so, firstly this is a website where the user sees a list of tasks which are uncomplete. It should work so the user clicks a complete button and then the item no longer shows, it seems not though!
When they click the 'complete' for an item I have onclick function executes a SQL update statement and then does a response.redirect back to that page, the sql statement executes correctly, the page does redirect BUT the list item is still there!
If the user then exits the page and comes back to it the list item HAS disappeared, this makes me think that the page is caching, however I have put the following in place to stop this:
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate, post-check=0, pre-check=0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
which is fine on my BlackBerry Bold running OS 5.0, but does not work for customers with BlackBerry Bold running OS 4.x
Any ideas of what this could be are most appreciated.
Try something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<title>Expires Example Page</title>
</head>
<body>
Hello World!
</body>
</html>
This is from the Blackberry support forum: http://supportforums.blackberry.com/t5/Web-Development/Browser-cache-and-quot-Back-quot-button/m-p/155986
How about this
http://developer.blackberry.com/bbos/html5/documentation/rim_cache_element_1264486_11.html
try changing disableAllCache to false in the config.xml
<rim:cache disableAllCache=["true" | "false"]
aggressiveCacheAge="time"
maxCacheSizeTotal="size"
maxCacheSizeItem ="size" />

Resources