MJ
asked on
Eval variables in function call
I need to be able to set the value of the variable in the string being passed. I can't break up the one parameter:
contentmediatype=content_t ype_media, contentcat egory=clas sification _category, contentbuc ket=classi fication_s ubcategory ,contentti tle=conten t_type_tit le
because it can be any number of assignments. The obvious issue is that I split out and eval the assignments but currently i don't get the values assigned to content_type_media, classification_category etc. because it just makes the values "content_type_media" not the actual value (value1)! How can I do this?
content_type_media = value1;
classification_category = value2;
...etc.
setOmniValues('','','','co ntentmedia type=conte nt_type_me dia,conten tcategory= classifica tion_categ ory,conten tbucket=cl assificati on_subcate gory,conte nttitle=co ntent_type _title','' , '', 1)
contentmediatype=content_t
because it can be any number of assignments. The obvious issue is that I split out and eval the assignments but currently i don't get the values assigned to content_type_media, classification_category etc. because it just makes the values "content_type_media" not the actual value (value1)! How can I do this?
content_type_media = value1;
classification_category = value2;
...etc.
setOmniValues('','','','co
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Compare to this:
<script>
content_type_media = 'value1';
classification_category = 'value2';
classification_subcategory
content_type_title ='value4';
setOmniValues('','','','co
function setOmniValues(a,b,c, theStatement){
alert(theStatement);
eval(theStatement);
alert(contenttitle);
}
</script>