• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaScript function help......URGENT

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was trying to build a js function dynamically from another function and trying to call it. But, somehow the dynamic function doesnt work. Can any one help me why the alert('hello') in the function: loadData_313937043() is not being called ?
------------------------------------------------------------------------
function testMe() {
var testUid= '313937043';
var ld = 'loadData_';
var ch = ld.concat(testUid).concat('()');
alert(ch);
ch;
}

function loadData_313937043() {
alert('hello');
}
------------------------------------------------------------------------
Regards,
Babu.
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you trying to do something like
var testUid= '313937043';
var ld = 'loadData_';
var args = "";
eval(ld + testUid + "(" + args + ")");
[ February 10, 2004: Message edited by: Yuriy Fuksenko ]
 
babukumar
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Yuriy Fuksenko, i forgot to wrap that up in eval !!
Regards,
kumar.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic