Script
function showcontent(language){
$('#content').html('Introduction to ' + language + ' language');
}
$(function(){
showcontent('java');
});
Content part:
<div id="content" region="center" border="true" title="" style="overflow:auto;padding:10px">
</div>
Selector bar:
<div title="Subscriber List Management" iconCls="icon-list">
<ul>
<li><a href="javascript:void(0)" onclick="showcontent('list/add.php')">Add List</a></li> //not works
<li><a href="javascript:void(0)" onclick="showcontent('test')">View List</a></li>
</ul>
</div>
This is the javascript that displays language I selected in a “content” panel. How can I modify it so that instead of $('#content').html('Introduction to ' + language + ' language'); the “content” displays an HTML/PHP page instead of some text?
You can use an AJAX $.load(), such as:
and then you can add your language variable after the fact.