For a kind of single page web app, I have to populate javascript arrays with
data from 4D arrays.

One way would be to use JSON.

But as there is no need to reload data after the initial load of the page, I
could send the data along with the html when loading the page.

Currently I do this quick and dirty within the loop for displaying a rowset:


$serEAN := ""
while ($rs->next)
    $row := $rs->getRow
        $serEAN := $serEAN + "," + "\""+$row{"EAN"}+"\""
        ...
end while

And later on I generate the arrays in javascript:

<script type="text/javascript" language="JavaScript">
$(document).ready(function(){
    var arEAN =new Array(<%= Substring($serEAN;2) %>);
   ...

Is there a cleaner approach for this task?

Pete


_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://active4d-nabble.aparajitaworld.com/

Reply via email to