code_junkie

JQuery Async postback issue, how do I fix this

Nov 13th, 2011
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $(function() {
  4. $("a[id ^='commentLink-']").click(function() {
  5. match = this.id.match(/commentLink-(d+)/);
  6. container = $("div#commentContainer-" + match[1])
  7. container.toggle();
  8.  
  9. if (container.is(":visible")) {
  10. container.load($(this).attr("href"));
  11. } else {
  12. container.html("Loading...");
  13. }
  14. return false; //Prevent default action
  15. });
  16. });
  17. </script>
  18.  
  19. $(function() {
  20. $("a[id ^='commentLink-']").live('click', function(event) {
  21. match = this.id.match(/commentLink-(d+)/);
  22. container = $("div#commentContainer-" + match[1])
  23. container.toggle();
  24.  
  25. if (container.is(":visible")) {
  26. container.load($(this).attr("href"));
  27. } else {
  28. container.html("Loading...");
  29. }
  30. event.preventDefault();
  31. });
  32. });
  33.  
  34. $("a[id ^='commentLink-']").click(function() {
  35.  
  36. $("a[id ^='commentLink-']").live('click', function(event) {
Add Comment
Please, Sign In to add comment