timeline
timeline copied to clipboard
We've uncovered a display problem with the timelines function on both websites. They've stopped working on Chrome, Safari, and FF, but still work fine on MS Edge
trafficstars
http://www.lfffoundation.com/article/timeline/id/78
http://www.makepublic.uk/campaign-timeline/8
Can you have a look at what might be happening here?
Hi @prince-acs
Both of these examples are calling a function getParameterByName when they initialise the timeline. The Wellcome examples do this too. In your examples, this function is missing - it's not part of the timeline codebase. On the Wellcome site this function is part of a utils script package, and is bundled into https://wellcomelibrary.org/mergedscript/1e06f900/TimelineMergedScript.js.
Here's the code for this function - it extracts query string params:
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if (results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}