I've read about these two different design approaches, I understand the theoric difference between Prog.Enhancement and Graceful Degradation, however I don't get the example you can read at this link: Progressive enhancement and Graceful degradation example
With G.D. he creates a link that through Javascript prints the page. With P.E. does the same, but he uses the "buttons" instead of "links".
This is the code used with P.E. process:
<p id="printthis">Thank you for your order. Please print this page for your records.</p>
<script type="text/javascript">
(function(){
if(document.getElementById){
var pt = document.getElementById('printthis');
if(pt && typeof window.print === 'function'){
var but = document.createElement('input');
but.setAttribute('type','button');
but.setAttribute('value','Print this now');
but.onclick = function(){
window.print();
};
pt.appendChild(but);
}
}
})();
</script>
Couldn't he do the same thing keep using links? I mean the problem of Javascript support keep existing even in P.E. and is solved exactly like in G.D., telling the user to print the page by himself.
Thanks in advance