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 %>
}
Jason I don't think you can embed the Active4D code in an included
Javascript file.
However you can approach the problem from a similar but different angle
and write Active4D code that dynamically generates the displayRecords
function for you based on some criteria. The difference is that if you
examine the resulting HTML you'll see the inline source for displayRecords.
-- Brad
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/