Create Screenshot of an scrollable iframe
This tiny tutorial describes how to capture a screenshot of a scrollable iframe in most modern browsers.
This tiny tutorial describes how to capture a screenshot of a scrollable iframe in most modern browsers.
/** * Removes leading and tailing whitespace(spaces, tabs, …) * from given string */ function trim (inputstring) { // first remove leading then tailing whitespaces // before removing the trimmed string return inputstring.replace (/^\s+/, ”).replace (/\s+$/, ”); }
 To add JavaScript or CSS files to the head section of the resulting HTML page, you can add something like this to the _prepareLayout function of a Block class: $headBlock = $this->getLayout()->getBlock(‘head’); $headBlock->addJs(‘somefolder/ask-sheldon.js’); $headBlock->addCss(‘somefolder/ask-sheldon.css’); As you can see, we can use the layout model to get the head block an use its functions to add files. This […]
With the following function you can read out the parameters from the currently opened URL: function getUrlparam (param) { var search = window.location.search.substring(1); if(search.indexOf(‘&’) > -1) { var params = search.split(‘&’); for(var i = 0; i < params.length; i++) { var key_value = params[i].split(‘=’); if(key_value[0] == param) return key_value[1]; } } else { var params […]