Guest User

Untitled

a guest
Aug 16th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <script type="text/javascript">
  2. {literal}
  3. //<![CDATA[
  4. var time_start;
  5. var time_end;
  6. $(document).ready(function() {
  7. $(".q").live('click', function() {
  8. var id = $(this).attr("id");
  9. $("#a"+id).fadeIn();
  10. $("#arrow"+id).html("<img src=\"images/arrow_open.png\"/>");
  11. $(this).removeClass("q").addClass("q2");
  12. });
  13.  
  14. $(".q2").live('click', function() {
  15. var id = $(this).attr("id");
  16. $("#a"+id).fadeOut();
  17. $("#arrow"+id).html("<img src=\"images/arrow_closed.png\"/>");
  18. $(this).removeClass("q2").addClass("q");
  19. });
  20.  
  21. $("a").click(function(){
  22. exit_page();
  23. });
  24. var d_s = new Date();
  25. time_start = d_s.getTime();
  26.  
  27. });
  28.  
  29. function exit_page(){
  30. var d_e = new Date();
  31. time_end = d_e.getTime();
  32. alert("boo!");
  33. $.ajax({
  34. type: "POST",
  35. url: "db_code/insert_faq.php",
  36. data: "location=Boston",
  37. success: function(msg){
  38. alert(msg);
  39. },
  40. error: function(xhr, textStatus, errorThrown){
  41. alert("fail: " + xhr+" "+textStatus + " " + errorThrown);
  42. }
  43. });
  44. }
  45. //]]>
  46. {/literal}
Add Comment
Please, Sign In to add comment