I have following code…
<script type="text/javascript">
var arr= new Array('10');
arr[0]='Need For Guru';
arr[1]='Qualities of a Guru';
arr[2]='Living Guru';
arr[3]='Who is a Satguru?';
arr[4]='Guru and Spiritual master';
arr[5]='Definition of discipleship';
arr[6]='Power of Faith';
arr[7]='Bad mouthing a Guru';
arr[8]='Fake Guru Shishya';
arr[9]='Pitfalls in the path of liberation';
var text='['+arr[0]+',\''+arr[1]+'\','+arr[2]+',\''+arr[3]+'\','+arr[4]+',\''+arr[5]+'\','+arr[6]+',\''+arr[7]+'\','+arr[8]+',\''+arr[9]+'\']';
document.write(text);
activatables('section', text );
</script>
My problem is that I want to use value of text as part of javascript code in line —
activatables('section', text ); .. so that code becomes like below
activatables('section', ['Need For Guru','Qualities of a Guru',...]);
But I am not able to do the same.. .can anyone help in this?
I think I understand what you are getting at… Do you want to serialize the array as text, and deserialize text into a new array?
To turn it into a string…
To turn the string into an array…
Obviously you don’t need to deserialize / parse the text if you already have access to the source variable… You can just plug it straight in.