X
Tap here to go to the mobile version of the site.

Support Forum

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

Posted

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>

Modified by cor-el

Additional System Details

This happened

Every time Firefox opened

This started when...

alert popup only happens for first button clicked.

Installed Plug-ins

  • np-mswmp
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Adobe PDF Plug-In For Firefox and Netscape "9.3.3"
  • Default Plug-in
  • Google Update
  • Shockwave Flash 10.1 r53
  • 4.0.50524.0
  • Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
  • Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
  • Npdsplay dll
  • DRM Store Netscape Plugin
  • DRM Netscape Network Object

Application

  • User Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729)

More Information

cor-el
  • Top 10 Contributor
  • Moderator
17536 solutions 158573 answers

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 Troubleshoot Firefox issues using Safe 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

It is working here.<br /> There have been some edits by moderators to the original code, probably because it didn't display properly, so you can check it.<br /> <nowiki>str = str+"<input type=text name=\"text_a\" value=''>";</nowiki> Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes). See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]