From: SourceForge.net <no...@so...> - 2005-08-04 03:13:39
|
Bugs item #870414, was opened at 2004-01-04 11:19 Message generated for change (Comment added) made by warp9pnt9 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105757&aid=870414&group_id=5757 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: DynAPI 3 API Group: Verified Status: Open Resolution: None Priority: 5 Submitted By: Sam Blum (bs_php) >Assigned to: L W (warp9pnt9) Summary: Check *before* setting the window.onload-function Initial Comment: There are cases where other 3rd party script are loaded that *also* overload the window.onload-function. In dynAPI should check that the window.onload- function is 'free'. Correction follows: ============= in dynapi.js near line 99 --------------- replace this ----------------- f.onload = function() { --------------- with this ----------------- // Befor setting the window.onload-function we must check if it's not already in use (by some other 3rd party script loaded). // So we backup the function to call it. var onloadBak = (typeof(f.onload)=='function') ? f.onload : false; f.onload = function() { if (onloadBak) onloadBak(); modified dynapi.js is attached ---------------------------------------------------------------------- >Comment By: L W (warp9pnt9) Date: 2005-08-03 23:13 Message: Logged In: YES user_id=706287 Hmm, do we stuff it before or after? I think it would be good to have a flag so we can specify, just incase order is pertinent. What if there's more than one function call there already? I think it would be nice to have an array of calls, one per entry, so we can have full control over order, and then have the DynAPI onload step through that array. Hmm, but how to achieve? A simple split on /;/ might work, but might fail if it's data, like foo("some; strings; and; stuff;"). I guess, as we parse through, we keep track of parens (inside function call), and then only pay attention to semi-colons outside function calls. Hmm, anyways, that might be too advanced for right now, and need to be revisited later. For now, maybe we'll just stick it either before or after? Any preference as to a default behavior? One tweak I might suggest is to set onloadBak to the null function instead of false, then we just call the Null function instead of performing a conditional check. I might attempt to gather empirical data by stuffing the case in a loop and run it 500,000 times or so. :) Then it should be evident if there's any advantage or not or browser-specific. I think, before we add advanced new features (and bugs), we need to get out of beta. :p New features like this are motivation to get there! As always, ping this again if you feel too much time has passed without a rsolution. ---------------------------------------------------------------------- Comment By: Doug Melvin (doug_melvin) Date: 2005-07-29 15:37 Message: Logged In: YES user_id=184788 very good point.. let's do that shall we? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105757&aid=870414&group_id=5757 |