Forum Discussion
TariqHussain
8 years agoBoss
1. Since lithium pages are a fully dynamic page,s jQuery load function works on pure HTML pages.
2. The better approach to is to create an endpoint for this and make a call to the endpoint to get it details.
Updated code for your navbar.
<ul> <#list blog.message as article> <li class="articlelinks"> <button id="${article.id}">${article.subject}</button></li> </#list> </ul>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> $(document).ready(function(){ $('button').click(function(){ var blogid = $(this).attr('id')
$.get("enpointurl",{id:blogid}, function(data, status){
alert("Data: " + data + "\nStatus: " + status);
}); });
In your endpoint use below the call to get the article.
<#assign articleID = http.request.parameters.name.get("id","") />
SELECT body FROM messages WHERE id '${articleID}'
Related Content
- 7 months ago
- 6 months ago
- 2 years ago