469,306 Members | 1,628 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Javascript eval help need URGENTLY

Hi,

I am trying to do the following but i get an error, is there no way i
can use eval to print have it assigned to a predeterminded variable.

eval (object_name + "_CalCalendar") = new CalendarPopup(object_name);

Cannot assign to function result

Thanks

Feb 2 '06 #1
2 1235
Sorry asleep for got to eval the whole statement

Feb 2 '06 #2
u1jd said the following on 2/2/2006 4:44 AM:
Sorry asleep for got to eval the whole statement


Nah, what you forgot was that you don't need eval in that construct.

window[object_name + "_CalCalender"] = .....
alert('Look Ma! No eval!!!')
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.