NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Cannot assign a function to JavaScript event; o_O.

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 11-21-2007, 10:40 PM THREAD STARTER               #1 (permalink)
NamePros Member
 
vilstewart's Avatar
Join Date: Jun 2007
Location: Mississippi, US
Posts: 30
vilstewart is an unknown quantity at this point
 



Help! Cannot assign a function to JavaScript event; o_O.


Alright, well I am trying to assign a function to a JavaScript Event for a retrieved element.

I will explain with code first :

Code:
window.onload = function() {

    var divBox = document.getElementById(someid)
    var divBox.onclick = someOtherFunction(arg,arg)

}

function someOtherFunction(arga,argb){
    var anotherDiv = document.getElementById(someid)
        anotherDiv.style.color='blue'
}
If I attempt to do something similar to the above code, it executes 'someOtherFunction' rather than just setting the onclick event to the function with the proper arguments that I need to send it.
????: NamePros.com http://www.namepros.com/programming/398460-cannot-assign-function-javascript-event-o_o.html

Any suggestions ? Thanks a lot guys
__________________
stewart:howe
Web Developer & Programmer
www.CelerMedia.Com
vilstewart is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:52 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger