By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,967 Members | 1,710 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,967 IT Pros & Developers. It's quick & easy.

Javascript eval help need URGENTLY

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
Sorry asleep for got to eval the whole statement

Feb 2 '06 #2

P: n/a
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.