I don't think the .js file will get parsed by Active4D so will never run the active 4D code. Are you saying it does run without an error?

Why not just embed the script in the a4D page and then it should work.

M.

On 24 Jul 2006, at 20:07, 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/

Reply via email to