Поиск в Поддержке

Избегайте мошенников, выдающих себя за службу поддержки. Мы никогда не попросим вас позвонить, отправить текстовое сообщение или поделиться личной информацией. Сообщайте о подозрительной активности, используя функцию «Пожаловаться».

Learn More

a htm file works fine at ver3.6.8 but abnormally at ver4.02b

  • 1 ответ
  • 1 имеет эту проблему
  • 18 просмотров
  • Последний ответ от cor-el

more options

following script can popup alert messages at ver3.6.8 but not at ver4.02b -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="utf-8">
<head>
	<title>TEST FOR FIREFOX 4</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>

<body onload='generate_input();'>
  <div id="display_area">
</body>
</html>

<script type="text/javascript">

function alert_value() {
  document.form_test.text_a.value=document.form_test.text_a.value.replace(/(^\s*)|(\s*$)/g,"");
  alert(document.form_test.text_a.value);
  generate_input();
}

function generate_input() {
  var str;
  str = str+'<form name=form_test>';
  str = str+"<input type=text name=\"text_a\" value=''>";
  str = str+'<input type=button onClick=\'alert_value()\'>';
  str = str+'</form>';
  document.getElementById("display_area").innerHTML=str;

}

</script> 
following script can popup alert messages at ver3.6.8 but not at ver4.02b --> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> &lt;html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="utf-8"> &lt;head> &lt;title>TEST FOR FIREFOX 4</title> &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> &lt;/head> &lt;body onload='generate_input();'> &lt;div id="display_area"></div> &lt;/body> &lt;/html> <script type="text/javascript"> function alert_value() { document.form_test.text_a.value=document.form_test.text_a.value.replace(/(^\s*)|(\s*$)/g,""); alert(document.form_test.text_a.value); generate_input(); } function generate_input() { var str; str = str+'<form name=form_test>'; str = str+"<input type=text name=\"text_a\" value=&apos;&apos;>"; str = str+'<input type=button onClick=\'alert_value()\'>'; str = str+'</form>'; document.getElementById("display_area").innerHTML=str; } </script> </pre></code>

Изменено cor-el

Все ответы (1)

more options

It is working here.

There have been some edits by moderators to the original code, probably because it didn't display properly, so you can check it.
str = str+"<input type=text name=\"text_a\" value=''>";

Start Firefox in Diagnose Firefox issues using Troubleshoot Mode to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes). See Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems and Troubleshoot issues with plugins like Flash or Java to fix common Firefox problems