Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $("#commentLink").click(function()
- {
- $("#commentContainer").toggle();
- if ($("#commentContainer").is(":visible"))
- {
- $("#commentContainer").load($(this).attr("href"));
- } else
- {
- $("#commentContainer").html("Loading..."); //Or just leave it as is...
- }
- return false; //Prevent default action
- });
- });
- <div id="SystemNews">
- <ul id="dc_news">
- <li>
- <a href="/Home/SystemNews/69" id="commentLink-0">Comments</a>
- <div id='commentContainer-0' style="display:none;"> Loading...</div>
- </div>
- </li>
- </ul>
- </div>
- jQuery(function($){
- $("a[id^='commentLink-']").click(function(){
- match = this.id.match(/commentLink-(d+)/);
- container = $("div#commentContainer-"+match[1])
- container.toggle();
- if (container.is(":visible")) {
- container.load($(this).attr("href"));
- } else {
- container.html("Loading...");
- }
- return false; //Prevent default action
- });
- });
Add Comment
Please, Sign In to add comment