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/

Reply via email to