Fix javascript errors in some browsers by moving autodetect script into onLoad handler
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 27 Aug 2003 05:56:46 +0000 (05:56 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 27 Aug 2003 05:56:46 +0000 (05:56 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5576 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/options/display.php

index 1493f9312840b8a156d80602ce2b6d3f4fabc4da..1e21532be940a3b5361ac1bc0be0a77b10699a35 100644 (file)
@@ -99,17 +99,14 @@ function load_optpage_data_display() {
                            SMPREF_JS_OFF        => _("Never"))
     );
 
-    $js_autodetect_script =
-        "<SCRIPT LANGUAGE=\"JavaScript\" TYPE=\"text/javascript\"><!--\n".
-           "document.forms[0].new_js_autodetect_results.value = '" . SMPREF_JS_ON . "';\n".
-        "// --></SCRIPT>\n";
+    $onLoadScript = "document.forms[0].new_js_autodetect_results.value = '" . SMPREF_JS_ON . "'";
     $js_autodetect_results = SMPREF_JS_OFF;
     $optvals[SMOPT_GRP_GENERAL][] = array(
         'name'    => 'js_autodetect_results',
         'caption' => '',
         'type'    => SMOPT_TYPE_HIDDEN,
         'refresh' => SMOPT_REFRESH_NONE,
-        'post_script' => $js_autodetect_script,
+        //'post_script' => $js_autodetect_script,
         'save'    => 'save_option_javascript_autodetect'
     );
 
@@ -315,7 +312,8 @@ function load_optpage_data_display() {
     /* Assemble all this together and return it as our result. */
     $result = array(
         'grps' => $optgrps,
-        'vals' => $optvals
+        'vals' => $optvals,
+        'xtra' => $onLoadScript
     );
     return ($result);
 }