Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Вёрстка веб-сайтов > Фиксированное значение в скрипте


Автор: Temp 4.10.2003, 14:08
Мне необходимо подправить код скрипта, а я не очень хорошо разбираясь в этом. Суть вот в чём:
В начале задано:
Код
function preview() {

 indicator = document.makeIndicator.indicator.selectedIndex;
 MyVar = document.makeIndicator.number.options[document.makeIndicator.number.selectedIndex].value
 
  if(indicator==0){
   indicatorWin=window.open("", "pagerWin2", 'toolbar=false,directories=false,status=false,menubar=false,scrollbars=1,resizable=1,width=300,height=20');

   indicatorWin.document.write(''+
   
   //PERSONAL INDICATOR //
   // TABLE STARTS HERE ////////////////////////////////////
 
     '<img src="http://web.icq.com/whitepages/online?icq='+document.makeIndicator.icq.value+'&img='+ MyVar +'">'+
 
   // TABLE ENDS HERE ////////////////////////////////////
    '');
      indicatorWin.document.writeln("</p></body>");
     }


Затем выбор:
Код
<span class="regText">
<nobr><span class="regTextB">Select design#:</span></nobr><br>
<select name="number">
<option>Select Design
<option value="0">1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
<option value="6">6
<option value="7">7
<option value="8">8
<option value="9">9
<option value="21">10
</select></span>


Как сделать чтоб сразу присваивалось значение 7 (без выбора). Если Вас не затруднит пишите подробнее. withstupid.gif

Автор: Z_P 4.10.2003, 16:43
напиши вот так место последнего:
Код

<span class="regText">
<nobr><span class="regTextB">Select design#:</span></nobr><br>
<select name="number">

<option value="0">1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
<option value="6">6
<option selected value="7">7
<option value="8">8
<option value="9">9
<option value="21">10
</select></span>


selected - это что должно быть сразу выделенно

Автор: Гость_DeathStorm 4.10.2003, 17:10
кажись можно в option на 7 поставить selected


Автор: Temp 4.10.2003, 21:30
Спасибо за совет но мне нужно чтоб само ниспадающее меню отсутствовало, и значение стояло на 7

Автор: Nobody 5.10.2003, 01:02
Хех... Ну и убери его. smile.gif
А вместо поставь
Код
<input type="hidden" name="number" value="7">

Автор: Temp 5.10.2003, 16:02
Не получается так. Я немного покастю покажу весь код. Мне нужно чтоб осталось поле ввода номера icq и кнопка посмотреть состояние.

Код

<script type="text/javascript" src="http://web.icq.com/js/search_radio_v1/0,,,00.js" language="JavaScript"></script>
<script language="javascript" src="http://web.icq.com/includes/js/cookie_lib/0,,,00.js" type="text/javascript"></script>
<script LANGUAGE="JavaScript1.1" SRC="http://ar.atwola.com/file/adsWrapper.js"></SCRIPT>
<script language="Javascript">
<!--
function preview() {

 indicator = document.makeIndicator.indicator.selectedIndex;
 MyVar = document.makeIndicator.number.options[document.makeIndicator.number.selectedIndex].value
 
  if(indicator==0){
   indicatorWin=window.open("", "pagerWin2", 'toolbar=false,directories=false,status=false,menubar=false,scrollbars=1,resizable=1,width=300,height=20');

   indicatorWin.document.write(''+
   
   //PERSONAL INDICATOR //
   // TABLE STARTS HERE ////////////////////////////////////
 
     '<img src="http://web.icq.com/whitepages/online?icq='+document.makeIndicator.icq.value+'&img='+ MyVar +'">'+
 
   // TABLE ENDS HERE ////////////////////////////////////
    '');
      indicatorWin.document.writeln("</p></body>");
     }
     
  if(indicator==1){
   indicatorWin=window.open("", "pagerWin2", 'toolbar=false,directories=false,status=false,menubar=false,scrollbars=1,resizable=1,width=100,height=20');

   indicatorWin.document.write(''+

  //ICQ PAGE INDICATOR //
   // TABLE STARTS HERE ////////////////////////////////////
   
    '<img src="http://web.icq.com/whitepages/online?web='+document.makeIndicator.icq.value+'&img=1">'+

  // TABLE ENDS HERE ////////////////////////////////////
      '');
   indicatorWin.document.writeln("</p></body>");
     }
   
   }
 
function create() {
 indicator = document.makeIndicator.indicator.selectedIndex;
 MyVar = document.makeIndicator.number.options[document.makeIndicator.number.selectedIndex].value
   if(indicator==0){
  document.makeIndicator.result.value=(''+

//PERSONAL INDICATOR //
// TABLE STARTS HERE ////////////////////////////////////
   
    '<img src="http://web.icq.com/whitepages/online?icq='+document.makeIndicator.icq.value+'&img='+MyVar+'">'+
// TABLE ENDS HERE ////////////////////////////////////    
   '');
   
  }
   
    if(indicator==1){
     
     document.makeIndicator.result.value=(''+
     
//ICQ PAGE INDICATOR //
  // TABLE STARTS HERE ////////////////////////////////////
 
   '<img src="http://web.icq.com/whitepages/online?web='+document.makeIndicator.icq.value+'&img=1">'+

 // TABLE ENDS HERE ////////////////////////////////////      
     '');
    }
   }    
//-->
</script>




<form name="makeIndicator">

<span class="regText">
<span class="regTextB">Your ICQ#</span> (required):<br>
<input type="text" name="icq">
</span>

<!--
<input type="hidden" name="indicator" value="Personal Status Indicator" class="regText">
-->

<span class="regText">Select the indicator:<br>
<select name="indicator">
<option>Personal Status Indicator
<option>ICQ Page Indicator
</select></span>


<span class="regText">
<nobr><span class="regTextB">Select design#:</span></nobr><br>
<select name="number">

<option value="0">1
<option value="2">2
<option value="3">3
<option value="4">4
<option value="5">5
<option value="6">6
<option selected value="7">7
<option value="8">8
<option value="9">9
<option value="21">10
</select></span>

<input type="button" onclick="preview()" value="Preview">
<input type="button" onclick="create()" value="Create My ICQ Status Indicator"><br><br>

<textarea name="result" cols="50" rows="7" wrap="virtual"></textarea>

</form>

Автор: Z_P 5.10.2003, 20:42
Temp
собвственно я не понял, что тебе надо в реалицазий? зачем уберать все и чтобы оставить только чтобы единственный результат был?
он же генерирует код для картинки которую надо вставить в пэйдж чтобы видно было твое состояние.

Автор: Temp 6.10.2003, 06:49
чтоб небыло ничего лишнего, а только кнопка проверить статус.

Автор: m@kxus 6.10.2003, 08:27
Код
<html>
<head>
 <script type="text/javascript" src="http://web.icq.com/js/search_radio_v1/0,,,00.js" language="JavaScript"></script>
 <script language="javascript" src="http://web.icq.com/includes/js/cookie_lib/0,,,00.js" type="text/javascript"></script>
 <script LANGUAGE="JavaScript1.1" SRC="http://ar.atwola.com/file/adsWrapper.js"></SCRIPT>
 <script language="Javascript">
  function preview() {
   MyVar = 7;
   indicatorWin=window.open("", "pagerWin2", 'toolbar=false,directories=false,status=false,menubar=false,scrollbars=1,resizable=1,width=300,height=20');
   indicatorWin.document.write('<img src="http://web.icq.com/whitepages/online?icq='+document.makeIndicator.icq.value+'&img='+ MyVar +'">');
   indicatorWin.document.writeln("</p></body>");
  }
 </script>
</head>
<body>
 <form name="makeIndicator">
  <span>
   <input type="text" name="icq">
   <input type="button" onclick="preview()" value="Status">
  </span>
 </form>
</body>
</html>

Автор: Temp 6.10.2003, 13:46
ОГРОМНОЕ СПАСИБО. ВСЁ ЗАРАБОТАЛО !!! smile.gif

Автор: Temp 6.10.2003, 13:52
А ещё подскажите как сделать такую кнопку которая будет обращатся к следующей странице : http://web.icq.com/whitepages/about_me/1,,,00.html?Uin=176723327 где "176723327" номер icq для которого есть поле ввода.

Типа "номер ICQ" и кн. "подробнее".

Автор: m@kxus 6.10.2003, 15:53
Код
<html>
<head>
 <script type="text/javascript" src="http://web.icq.com/js/search_radio_v1/0,,,00.js" language="JavaScript"></script>
 <script language="javascript" src="http://web.icq.com/includes/js/cookie_lib/0,,,00.js" type="text/javascript"></script>
 <script LANGUAGE="JavaScript1.1" SRC="http://ar.atwola.com/file/adsWrapper.js"></SCRIPT>
 <script language="Javascript">
  function preview() {
   MyVar = 7;
   indicatorWin=window.open("", "pagerWin2", 'toolbar=false,directories=false,status=false,menubar=false,scrollbars=1,resizable=1,width=300,height=20');
   indicatorWin.document.write('<img src="http://web.icq.com/whitepages/online?icq='+document.makeIndicator.icq.value+'&img='+ MyVar +'">');
   indicatorWin.document.writeln("</p></body>");
  }
  function details() {
   window.open('http://web.icq.com/whitepages/about_me/1,,,00.html?Uin=' + document.makeIndicator.icq.value);
  }
 </script>
</head>
<body>
 <form name="makeIndicator">
  <span>
   <input type="text" name="icq">
   <input type="button" onclick="preview()" value="Status">
   <input type="button" onclick="details()" value="Details">
  </span>
 </form>
</body>
</html>

Автор: Temp 6.10.2003, 21:52
Круто! Всё работает

Автор: Temp 11.10.2003, 15:05
И ещё совсем один дуратский вопрос: Как сделать чтоб "Details" открывался во фрейме? withstupid.gif withstupid.gif withstupid.gif

Автор: Unregistered 13.10.2003, 01:07
Код
<html>
<head>
<script type="text/javascript" src="http://web.icq.com/js/search_radio_v1/0,,,00.js" language="JavaScript"></script>
<script language="javascript" src="http://web.icq.com/includes/js/cookie_lib/0,,,00.js" type="text/javascript"></script>
<script LANGUAGE="JavaScript1.1" SRC="http://ar.atwola.com/file/adsWrapper.js"></SCRIPT>
<script language="Javascript">
 function preview() {
  MyVar = 7;
  indicatorWin=window.open("", "pagerWin2", 'toolbar=false,directories=false,status=false,menubar=false,scrollbars=1,resizable=1,width=300,height=20');
  indicatorWin.document.write('<img src="http://web.icq.com/whitepages/online?icq='+document.makeIndicator.icq.value+'&img='+ MyVar +'">');
  indicatorWin.document.writeln("</p></body>");
 }
 function details() {
  document.all('ifr1').src = 'http://web.icq.com/whitepages/about_me/1,,,00.html?Uin=' + document.makeIndicator.icq.value;
 }
</script>
</head>
<body>
<form name="makeIndicator">
 <span>
  <input type="text" name="icq">
  <input type="button" onclick="preview()" value="Status">
  <input type="button" onclick="details()" value="Details">
  <br>
  <iframe id="ifr1" style="width:600px;height:400px;"></iframe>
 </span>
</form>
</body>
</html>

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)