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/