[Pro] Javascript for Search Field, Safari problems

I know I can solve the problem by simple edits in TextWrangler:

  1. Delete ‘window.onload’ from my JS, and uniquely name my function.
  2. Add that new function name in the body ‘onload’.
//clear & unselect search field on page load
function SFcleaner(){
 var GF = document.getElementById("Field");
 //delete field contents and defocus on page load
 GF.value = "";
 GF.blur();
 //delete field contents and defocus when user clicks outside field
 GF.addEventListener("blur", function COF() {GF.value = '';});
}
<body onload="FWPreload();SFcleaner();">

But the problem is that Freeway auto-creates the “FWPreload()” in the body tag when needed. I cannot manually edit all my pages every time the site is rebuilt in Freeway.

I would appreciate hearing your thoughts.

Thanks!

James W.


dynamo mailing list
email@hidden
Update your subscriptions at: