Hi Wilson,
That's the way I was going first but I was concerned that I'd be overwriting or
somehow preventing _spBodyOnLoadWrapper from running as expected. I'm no
JavaScript guru so couldn't really see how to trace what was going on with the
page.
I don't know how to test for PostBack either but, given that I have the search
results web part on the same page, this would always be the case?
I have come up with the following. It's simple but appears to do the trick
(although I think it's usage is probably limited to once per page).
function myFunction() {
if (case)
{
// Do something
}
}
if( window.onload ) {
myFunction;
}
Do you see any problem with this approach? If so, I am just as happy to use
your method instead.
Now what I'd really like to do is prevent multiple selections by unchecking
everything else when a selection is made but can't see how to do this without
having the function called by onClick on the checkboxes. :\
From: [email protected] [mailto:[email protected]] On Behalf Of Wampers, Wilson
[Talent International]
Sent: Monday, 22 December 2008 9:44 AM
To: [email protected]
Subject: RE: Getting around _spBodyOnLoadWrapper
Hi Paul,
I've successfully implemented:
function _spBodyOnLoad() {yourFunctionCall()}
function yourFunctionCall()
{
var doSomethingHere = "I'm doing it here";
alert(doSomethingHere );
}
You probably want to test whether or not you're in PostBack, and so only embed
JavaScript when it's appropriate...
Let me know if this is what you were after.
Kind Regards,
Wilson Wampers
From: [email protected] [mailto:[email protected]] On Behalf Of Paul Noone
Sent: Monday, 22 December 2008 07:24
To: [email protected]
Subject: Getting around _spBodyOnLoadWrapper
My earlier excitement at discovering I could add JavaScript directly to content
editor web parts was quashed upon realising that any onload events I might
require were being overridden by the master page's onload call to
_spBodyOnLoadWrapper in the body tag.
Has anyone found a clever way to add extra onload events to a page without
modifying the core.js files?
Has anyone written a wrapper function that checks for onload events and allows
you to add extra functions as required? Or is there another way?
Any advice appreciated.
________________________________
List address: [email protected]
Subscribe: [email protected]
Unsubscribe: [email protected]
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
________________________________
List address: [email protected]
Subscribe: [email protected]
Unsubscribe: [email protected]
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists
--------------------------------------------------------------------------------
List address: [email protected]
Subscribe: [email protected]
Unsubscribe: [email protected]
List FAQ: http://www.codify.com/lists/ozmoss
Other lists you might want to join: http://www.codify.com/lists