Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. // addLoadEvent(setupstuff);
  2.  
  3. // function addLoadEvent(func)
  4. // {
  5. // var oldonload = window.onload;
  6.  
  7. // if (typeof window.onload != 'function')
  8. // {
  9. // window.onload = func;
  10. // }
  11. // else
  12. // {
  13. // window.onload = function ()
  14. // {
  15. // if (oldonload)
  16. // {
  17. // oldonload();
  18. // }
  19. // func();
  20. // };
  21. // }
  22. // }
  23.  
  24. var txtLocation = '<%=txtLocation.ClientID%>';
  25.  
  26. // JQuery plugin - JQueryLive (waits for element)
  27. $('#' + txtLocation).livequery(function ()
  28. {
  29. setupstuff();
  30. });
  31.  
  32.  
  33. //$(document).ready(function () //didn't work
  34. //$(window).load(function() //didn't work
  35. function setupstuff()
  36. {
  37. // search text watermark toggling
  38. var hasWatermark = $('#' + txtLocation).hasClass('txtLocationWatermark');
  39.  
  40. var searchText;
  41. if (document.getElementById(txtLocation))
  42. {
  43. searchText = document.getElementById(txtLocation).value;
  44. }
  45. else
  46. {
  47. alert('Element ' + txtLocation + ' not found in DOM!');
  48. return;
  49. }
  50. //var searchText = $('#' + txtLocation).val(); //doesn't work either
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement