[Pro] Javascript for Search Field, Safari problems

Walter,

I’ve discovered one caveat to my code. On pages in my Freeway site where I use the Rollover Action, I always choose “Preload: Yes” in the “Parameters” section (Actions palette). That results in the following HTML output:

<body onload="FWPreload()">

That conflicts with the JS I wrote (to defocus and clear my search field) due to the existence of 2 “onload” instructions:

//defocus search field and clear its contents under 2 conditions
window.onload = function(){
 var GF = document.getElementById("Field");
 //condition1: on page load
 GF.value = "";
 GF.blur();
 //condition2: when user clicks outside field
 GF.addEventListener("blur", function COF() {GF.value = '';});
}

Disabling “Preload” on all my Rollovers is a fix (that deletes the ‘onload’ in the ‘body’ tag), but there are two big problems with that:

  1. It’s a lot of work.
  2. Rollover images won’t show instantly, which I consider a problem.

And deleting ‘onload’ from my JS code isn’t an option either as that clears and defocuses the search field as I desire.

Would you know of any tricks to resolve this?

Thanks,

James W.


dynamo mailing list
email@hidden
Update your subscriptions at: