Thanks Tom, I understand what you are saying.

Is there a way that I can:

1. query the database
2. take the resulting records and put them in a structure
3. pass the structure to a JS function for display purposes.

Now I see RowSet, but I just cannot put it together right to pass it to a generic .js function for display.

Can anyone give me an example?

-Jason









On Jul 24, 2006, at 3:59 PM, Thomas DeMeo wrote:

Hi,

You can embed Active4D code in a .js file:

See the Active4D.ini file and look for executable extensions . You can tell Active4D to parse other extensions there.


However, remember Javascript is executed on the browser client. The Active4D execution would take place before the code is delivered to the browser.


Tom DeMeo




On Jul 24, 2006, at 3:07 PM, Jason T. Slack wrote:


Can one embed A4D code in a .js file and include that .js file in an a4d page? I cannot seem to figure it out correctly.

Example:

in an a4d page:

<%
if ([PersonAttributes]ArtworkEnroll)
                                                %>
<td width="10"><input type="button" value="Artwork" onClick="displayRecords('Artwork')"></td>
                                                        <div id="Artwork"></div>
                                                <% end if %>

in a .js file:

function displayRecords(articlesToDisplay)
{
        var divElement = document.getElementById(articlesToDisplay)
        
        <% query ([Artwork];[Artwork]ID=[Person]ID)%>
                
                <% for each([Artwork]; $i) %>
divElement.innerHTML = <% writebr('[Artwork]ArtworkDate - [Artwork]ArtworkTitle - [Artwork]ArtworkDetails') %>
                <% end for each %>                
}

I am expecting some data from my 4D database to show up, but nothing, if I get rd of the 4D commands, and replace it with a generic peice of text, I get it to appear just fine.

if I cannot do this, can I pass a RowSet with the records that I want as a parameter and do something with it in the .js file?

Thoughts are appreciated.

-Jason



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


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


Jason T. Slack
Department of Psychology
Cornell University
[EMAIL PROTECTED]
            



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

Reply via email to