Need a little help with an external JavaScript event handler
Posted: Sun Apr 15, 2007 10:37 pm
feyd | Please use
I'm trying to remove all JavaScript code from the page itself. Here is my not working but best guess at the moment...
What am I doing wrong here?
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
My original code is this...
[syntax="html"]<a href="#" id="personalaudio" onclick="change('audio', 'promptshow'); change('body', 'body fade'); change('head', 'head fade'); $('#inset04').CloseVertically(500); return false;" Code: Select all
function init28() {
if (document.getElementById('personalaudio')) {
personalaudio.onclick= function(){personalaudio()};
function personalaudio(){change('audio', 'promptshow'); change('body', 'body fade'); change('head', 'head fade'); }
}
} window.onload = init28;feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]