Monday, August 16, 2010

How to put Elements from a ASP pupolated array to Javasrcipt Array?

Need help.


I have pupolated an array using ASP and later in that page, I have used some javascript. Now I want the element of the array wich pupolated in ASP to copy to the Array I need in Javascript.


Please tell me the way I follow.


Any practical code example will be highly appreciated.





thanksHow to put Elements from a ASP pupolated array to Javasrcipt Array?
When you say ASP, I am assuming it is VBScript.


Stored the array in a hidden input element by joining the array to a string.





You can use javascript to retrieve the string.How to put Elements from a ASP pupolated array to Javasrcipt Array?
One way to do it:





var str = %26lt;% join(vbscriptArray, ';;';) %%26gt;





str.split(';;';)





The stuff between %26lt;% %%26gt; is evaluated on the server and put on the html page - there you let the javascript code run.

No comments:

Post a Comment