Update: All 6 tests passed. Google displayed the lyrics in search results for all the tests. I have added screenshots of the results below each test.
- Test the search engine’s ability to account for dynamically inserted text when the text is within the HTML source of the page.
Test 1 – document.WriteIn
The article mentions a successful test using document.writeIn so my first test will use this method. For the first part of the test the text is within the HTML source of the page. Here is the code I’m using:
document.writeln("Lyrics will go here");
Test 2 – insertAdjacentHTML
Now let’s do the same with insertAdjacentHTML using the first verse of Sia’s Elastic Heart. First with the text within the HTML source of the page using the following code:
document.getElementById("elastic-heart-lyrics").insertAdjacentHTML( "afterbegin", "Lyrics will go here" );
Test 3 – jQuery append()
$( "#sorry-lyrics" ).append( "Lyrics will go here" );
And now the same code, but with the text outside the HTML source, and using the second verse of the song Sorry:
Now what about Bing, the second most popular search engine? This article has been indexed, but any refinement of the search fails to find the lyrics. If you’ve had any luck with Bing send me a Tweet.