Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 1.91 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <script>
  2. var tmp = new Array();          // два вспомагательных
  3. var tmp2 = new Array();         // массива
  4. var param = new Array();
  5.  
  6. var get = location.search;      // строка GET запроса
  7. if(get != '') {
  8.         tmp = (get.substr(1)).split('&');       // разделяем переменные
  9.         for(var i=0; i < tmp.length; i++) {
  10.                 tmp2 = tmp[i].split('=');               // массив param будет содержать
  11.                 param[tmp2[0]] = tmp2[1];               // пары ключ(имя переменной)->значение
  12.         }
  13.  
  14. }
  15. jQuery(document).ready(function(){
  16.         if(jQuery("#aff_country_select option:selected").val() == "169")
  17.         {
  18.                 jQuery("#aff_message_block").hide();
  19.                 jQuery("#aff_enter_caption").text("Введите номер телефона:");              
  20.                 jQuery("#aff_form_block .step").text("2");
  21.         }
  22.         jQuery("#aff_country_select").change(function () {
  23.                 if(jQuery("#aff_country_select option:selected").val() == "169")
  24.                 {
  25.                         jQuery("#aff_message_block").hide();
  26.                         jQuery("#aff_enter_caption").text("Введите номер телефона:");              
  27.                         jQuery("#aff_form_block .step").text("2");
  28.                 }
  29.                 else
  30.                 {
  31.                         jQuery("#aff_message_block").show();
  32.                         jQuery("#aff_enter_caption").text("Введите полученные данные:");
  33.                         jQuery("#aff_form_block .step").text("3");
  34.                 }
  35.         });
  36.         jQuery("#aff_submit").click(function () {
  37.                 if(jQuery("#aff_enter_caption").text() == "Введите номер телефона:")
  38.                 {
  39.                         if(jQuery("div#aff_form_block .aff_content div:eq(2) input").val()!="")
  40.                         {
  41.                                 var v = "";
  42.                                 var d  = "";
  43.                                 if(param['user_id']!=null) {var d = "&user_id="+param['user_id'];}
  44.                                 if(param['sub_id']!=null) {var v = "&sub_id="+param['sub_id'];}
  45.                                 window.location = "/subscribe.php?phone="+jQuery("div#aff_form_block .aff_content div:eq(2) input").val()+d+v;
  46.                         }
  47.                         else
  48.                         {
  49.                                 alert("Введите номер телефона");
  50.                         }
  51.                 }
  52.         });
  53. });
  54. </script>