Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. $(document).ready(function(){
  2. var zipCodes =[60538,60504,75001,76008,75002,75013,76009,76225,75409,76226,76001,76002,76006,76010,
  3. 76011,76012,76013,76014,76015,76016,76017,76018,76227,76020,75413,75180,75101,76021,
  4. 76022,75414,76126,75424,75418,76023,76028,75135,75006,75007,75010,76127,75104,75423,
  5. 75009,75105,76031,75211,76034,76233,75121,75019,75114,76035,76036,];
  6. $("#buttontest").click(function(){
  7. var zipIndex = zipCodes.indexOf(parseInt($("#full_day").val()));
  8. $("#zipMessage > div").hide("fast");
  9. var zipId = zipIndex > -1 ? zipCodes[zipIndex] : "Error";
  10. $("#zip"+zipId).show("fast");
  11. });
  12.  
  13. $("#full_day").keydown(function(e){
  14. if(e.which === 13){
  15. $("#buttontest").click();
  16. }
  17. });
  18. });
  19.  
  20. $("#some_button").on('click', function(e) {
  21. $.ajax({
  22. type: 'POST',
  23. url: 'some_php_script.php',
  24. data: {foo : "bar"}
  25. })
  26. .done(function(results) {
  27. // check to see if results is actually html
  28. // going to assume it is for the sake of example
  29. $("#zip60538").html(results);
  30. });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement