Continuing on with Google Search Console (part of โGoogle Webmastersโ) โCrawl Errorโ issues here at the RJM Programming domain, on top of yesterdayโs Google Crawl Incompatible Plugin Error Tutorial, today we examine another โCrawl Errorโ category (in the Mobility Fix super category) called โฆ
Viewport not set to "device-width"
โฆ the viewport meta tag being an important step towards a webpage being suitable for the variety of device widths that happen now with the many mobile platforms.
As with yesterdayโs work the RJM Programming domain URL of interest today is https://www.rjmprogramming.com.au/MyBusinessEins/index.html which we tested our local MAMP Apache/PHP/MySql web server code changes (sftpโed up to the RJM Programming domain) with an (iOS) iPhone 6.
And so, within the <head> </head> section we plumped for the โฆ
- viewport meta tag โฆ
<meta name="viewport" content="width=device-width, initial-scale=0.4">
โฆ and then tried, for mobile platforms such as the iPhone 6 to โฆ - try to make the text of the web page that little bit bigger (and so more legible but perhaps non-intuitively) โฆ called at the document.body onload event โฆ
<body style="background: #ffffff url(Welcome_files/PhotoGray_nav_bg.jpg) repeat scroll top left; margin: 0pt; " onload="onlm(); setTimeout(avoidflash,2000); onPageLoad();" onunload="onPageUnload();">
โฆ calling the new Javascript functions (thanks to this great webpage) โฆ
<script type='text/javascript'>
function changeFont(element) { // thanks to https://stackoverflow.com/questions/16460990/change-text-font-size-of-whole-page-content
element.setAttribute("style",element.getAttribute("style")+";font-size: 103%");
for(var i=0; i < element.children.length; i++){
changeFont(element.children[i]);
}
}
function onlm() {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
document.getElementById('widget1').style.left='400px'; // make way
document.getElementById('widget1').style.width='260px'; // for the
document.getElementById('widget1').style.height='80px'; // bigger text here
changeFont(document.getElementsByTagName("body")[0]);
}
}
</script>
Click the Validate Fix button back at Google Search Console and the issue is fixed, or a reworked code cycle begins, hopefully the former.
You can also see this play out at WordPress 4.1.1โs Google Crawl Viewport Error Tutorial.
Previous relevant Google Crawl Incompatible Plugin Error Tutorial is shown below.
As a webmaster it can be good to get an outside view of the issues on the website you manage. Google provide this with Google Search Console (part of โGoogle Webmastersโ) as a โฆ
- search engine โฆ helping out webmasters of websites in relation to โฆ
- the search engine crawling of URLs they discover with regard to your website domain
โฆ with a variety of โCrawl Errorโ category we last talked about with, regarding โBroken Linksโ when we presented the previous Google Crawl Errors Primer Tutorial below.
Today, we revisit โGoogle Crawl Errorโ territory, this time regarding a โCrawl Errorโ category โUses incompatible pluginsโ. The URL pointed to by the error message link got us to โฆ
- https://www.rjmprogramming.com.au/MyBusinessEins/index.html โฆ and we knew what would be the incompatibility here, yet you should read below us being objective here, getting to the same conclusion that โฆ
- Adobe Flash Player was the applicable โincompatible pluginโ here, with this Google Crawl Error
This is a troubleshooting issue. As such, we recommend acting in an objective way, and try to find an independent test environment both to โฆ
- recreate the live environment, enough, to mimic the problem of the โliveโ URL with a โtestโ equivalent (so downloaded, via sftp, the โsubdomainโ (sort of) to our local MAMP Apache/PHP/MySql web server) โฆ where we saw an Adobe Flash Player window warning of the issue and offering to โDownload Flashโฆโ, an offer we have decided to skirt around (but read on) โฆ
- prove/disprove or find out what is wrong on the โtestโ web server
- change code of the โtestโ web server and unit test and rechange and test again until satisfied, on the โtestโ web server
- show a working set of changed code on the โtestโ web server
- upload, via sftp, changed โtestโ web server files to the โliveโ web server
โฆ a tried and many times tested paradigm, that in broad brush terms, suits many types of troubleshooting problems.
Within prove/disprove or find out what is wrong on the โtestโ web server we โฆ
- turned off the need for Adobe Flash Player via the !โ and โ encased โฆ
<!--object type="application/x-shockwave-flash" width="122" height="110" id="BZ9F1B51BAAA56473FBB39" data="bzAnimation.swf?swfId=BZ9F1B51BAAA56473FBB39&xmlPath=bz.xml&imgPath=img&soundPath=false&urlType=_top&showInfo=1&themeMode=2"><param name="movie" value="bzAnimation.swf?swfId=BZ9F1B51BAAA56473FBB39&xmlPath=bz.xml&imgPath=.//img&soundPath=false&urlType=_top&showInfo=1&themeMode=2" /><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param>
</object-->
โฆ and lo and behold, Adobe Flash Player plugin no longer required, the good news, but the not so good news is a lack of animation interest โฆ so โฆ - examining the webpage via the web browser web inspector we discovered that there was an HTML5 canvas element left behind for us to work with, and we decided to do our own animation with this canvas via new document.body onload call โฆ
<body style="background: #ffffff url(Welcome_files/PhotoGray_nav_bg.jpg) repeat scroll top left; margin: 0pt; " onload="setTimeout(avoidflash,2000); onPageLoad();" onunload="onPageUnload();">
โฆ calling on new Javascript โฆ
<script type="text/javascript">
var imgs=['img/E2056759-788F-47B2-B890.png','img/4BFD4F98-069C-450F-9B2F.png','img/13925BFD-163A-439F-8CBB.jpg','img/BFA442D7-A0A2-48E0-AE4C.jpg','img/F6351070-2CC4-4914-A785.jpg','img/E9BFF839-D932-49B4-8270.jpg','img/EA588468-4D33-4FD6-9D25.png','img/37FA1992-4889-4F6D-84AD.jpg','img/1781F2A2-50AC-4A89-94E5.jpg','img/4B76B23B-840C-4E0B-B57C.jpg','img/16C4852F-A463-452B-BACA.jpg'];
var elem=[null];
var context=[null];
function chooseanother() {
var iuy=Math.floor(Math.random() * imgs.length);
document.getElementById('imgf').src=imgs[iuy] + '?x=' + Math.floor(Math.random() * 19876543);
}
function showthis(ithis) {
for (var ics=1; ics<context.length; ics++) {
context[ics].drawImage(ithis, 0, 0, ithis.width, ithis.height, 10, 10, eval(-20 + elem[ics].width), eval(-20 + elem[ics].height));
}
setTimeout(chooseanother, 2000);
}
function avoidflash() {
var cs=document.getElementsByTagName('canvas');
if (cs.length > 0) {
elem[0]=cs[0];
context[0]=elem[0].getContext('2d');
for (var ics=1; ics<cs.length; ics++) {
elem.push(cs[ics]);
context.push(cs[ics].getContext('2d'));
}
document.getElementById('iidiv').innerHTML='<img onload=showthis(this); id=imgf src=' + imgs[0] + '></img>';
}
}
</script>
โฆ to suit our purposes, not quite as cute as Flash, but serviceable, and animated - back at โGoogle Crawl Errorsโ click the โValidate Fixโ button to the right of โDone fixing?โ wording to see whether your fix also fixes Googleโs โCrawl Viewโ of the website affected
Previous relevant Google Crawl Errors Primer Tutorial is shown below.
When you are a webmaster (of a web domain, such as www.rjmprogramming.com.au) registered with Google you can receive (Google) console notifications from unusual events. Thanks for the heads up, Google. This is like a sanity check, independently, for webmasters, registering websites at Google.
Lately, weโve been noticed a bit, we guess, because of the introduction of index.htm into the picture (that we talked about last with Landing Page Mobile Phone Crontab Curl Tutorial) โฆ youโll see it middle top of todayโs tutorial picture โฆ saying cheese โฆ sorry, the dogs got involved in todayโs blog posting โฆ theyโre sooooooooooo immature โฆ unlike the humans, of course!?
Anyway, mistakes of the past hand crafting blog posting have come back to bite, and the Google crawl error count for error 404 has gone up, for www.rjmprogramming.com.au, quite a bit lately. Another term for this is โbroken linksโ.
No excuse, but when hand crafting blog posts, care is needed with HTML a links, pretty obviously, regarding โฆ
- spelling mistakes
- copying and pasting (absolute) URLs (often from a search engine result set) and forgetting the // or https:// bit (which does not always appear with a copied URL from the search engine results, for instance) โฆ which, if left out, as you can imagine, leads the web browser to want to search through your domain for that (what becomes โorphanedโ) URL reference โฆ we make this mistake quite a bit with Wikipedia and W3schools โฆ sorry, guys
- for us, moving between WordPress blog URLs that are non-permalink pointing to the permalink ones and misspelling, or not properly working(/mapping) out the permalink, or forgetting to change the blog posting title into its URL-part-of constituent (see also WordPress Upgrade Links Tutorial), properly, in our heads (Nala??!!)
Of course, all this should be checked with the WordPress (Blog Post) Preview button ahead of it going live, but, there you go. Nala????!!!! Weโre fixing them gradually, as an ongoing issue.
Weโve talked about broken links, and a programmable way to detect them, previously, with More Bookmarklet via Javascript Tutorial and WordPress plugins such as Broken Link Checker could help with this issue, as well.
And youโll be pleased to know No puppy feelings were hurt in the production of this blog posting โฆ it ended up being my fault.
Previous relevant More Bookmarklet via Javascript Tutorial is shown below.
Have you heard of Bookmarklets?
Are you a person with a cluttered (thoughtfully placed, of course) desk?
Yes? Read on โฆ even if not, โGo to Jail โฆ Do Not Pass Goโ (maybe you were impressed by that idea that the Lordโs Prayer was Once Etched on a Pinhead? โฆ yes? โฆ read on down below โฆ are you here? โฆ oops โฆ cโest la vie โฆ read on) โฆ read on โฆ why?
This tutorial builds on Bookmarklet via Javascript Primer Tutorial below. For our tutorial we write a bookmarklet to check for Broken Links, something that could be very useful to run against the very common Links pages on websites today, so that you can check for those Broken Links that annoy the search engines so much and contribute to a lower SEO โscoreโ.
<script type=โtext/javascriptโ>
function checkBrokenLink() {
var bWin,j,b=โ,tl=40,dl=document.links;
for(j=0;j<dl.length;j++){
if(b.indexOf(dl[j].href)<0){
bWin=window.open(dl[j].href,โBWโ+j,โtop=โ+tl+โ,left=620,width=400,height=120,
scrollbars=yes,menubar=no,titlebar=no,toolbar=no,status=noโ);
tl+=120;
b+='<tr style=โheight:120โณ><td>โ+dl[j].href+'</td><td>โ;
b+=dl[j].target+'</td><td>โ+dl[j].id+'</td><td>โ;
b+=dl[j].className+'</td><td>โ></td></tr>โ;
}
}
if(b===โ){
alert(โNo linksโ);
}else{
bWin=window.open(โ,โLinks of โ+document.title,โtop=0,left=0,width=600,height=800,scrollbars=yesโ);
bWin.title=โLinks of โ+document.title;
bWin.document.body.innerHTML='<table border=1 cellpadding=5 cellspacing=0><tr><th>Link of โ;
bWin.document.body.innerHTML+=document.title+'</th><th>Target</th><th>ID</th><โ;
bWin.document.body.innerHTML+=โth>Class</th><th>Broken?</th></tr>โ+b+'</table>โ;
}
}
</script>
To get some downloadable Javascript programming code for this bookmarklet please rename to BrokenLinksjs and copy its contents into the address of your Bookmarklet to try this yourself.
Okay, if you have downloaded, take a look at how similar it is to code above. So you just place javascript: in front of the Javascript code required to do something interesting, all squeezed together onto the one line (no pinheads please) โฆ this is where the cluttered desk people may continue breathing easily but others may falter.
Well, if you can place this sort of thing into a browser Bookmark then that is a Bookmarklet. Remember the Javascript calculator rave in previous tutorials?
Bear in mind we show Firefox in tutorial but all browsers have something similar, whether that be called Bookmarks or Favourites. Our tutorial shows the Safari browser using this Bookmarklet.
Regarding this Bookmarklet tutorial topic I really like โJavaScript & Ajaxโ seventh edition by Tom Negrino and Dori Smith.
Click onpicture above to go to tutorial about Bookmarklets.
Did you know โฆ
JavaScript makes a great easy-access Calculator?
Try typing the lines below into the address bar of your favourite browser:
Javascript: eval(512 / 380);
Javascript: eval(512 * 380);
Javascript: eval(512 โ 380);
Javascript: eval(512 + 380);
Javascript: eval(512 % 380);
These days we spend so much time on the Internet it is a much quicker way to get to a calculator!
Previous Bookmarklet via Javascript Primer Tutorial below โฆ
Have you heard of Bookmarklets?
Are you a person with a cluttered (thoughtfully placed, of course) desk?
Yes? Read on โฆ even if not โฆ read on โฆ why?
<html>
<head>
</head>
<body>
<script type=โtext/javascriptโ>
while (โabracadabraโ != prompt(โGuess the magic word?โ).toLowerCase()) {
alert(โBad Luckโ);
}
document.write(โ<html><body><p>You win a cupee doll!</body></html>โ);
</script>
<a href=โ#โ onclick=โjavascript: while (โabracadabraโ != prompt(โGuess the magic word?โ).toLowerCase()) { alert(โBad Luckโ); } document.write(โ<html><body><p>You win a cupee doll!</body></html>โ);โ>Click me for another (confirmed) go โฆ but limited offer on cupee dolls!</a>
</body>
</html>
Look at the cutesy wootsey HTML/Javascript above. Isnโt it cuuuuuuute?!
Isnโt it sweeeeeet?!
โซ Oh, aint she sweet, when sheโs walking down the street,
Well I ask you very confidentially โฆ aint โฆ she โฆ sweet. โซ
Enough of a sell job?
Okay look at the Javascript of one vs Javascript of one below in the a tag onclick bit. So you just place javascript: in front of the Javascript code required to do something interesting, all squeezed together onto the one line โฆ this is where the cluttered desk people may continue breathing easily but others may falter.
Well, if you can place this sort of thing into a browser Bookmark then that is a
Bookmarklet. Remember the Javascript calculator rave in previous tutorials?
Bear in mind we show Firefox in tutorial but all browsers have something similar, whether that be called Bookmarks or Favourites.
Click onpicture above to go to tutorial about Bookmarklets.
Link to downloadable source code of HTML above is bmarkhtml which you need to rename in order to try.
Did you know โฆ
JavaScript makes a great easy-access Calculator?
Try typing the lines below into the address bar of your favourite browser:
Javascript: eval(512 / 380);
Javascript: eval(512 * 380);
Javascript: eval(512 โ 380);
Javascript: eval(512 + 380);
Javascript: eval(512 % 380);
These days we spend so much time on the Internet it is a much quicker way to get to a calculator!
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.