assign myname js variable
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Fri, 17 Apr 2020 05:32:55 +0000 (07:32 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Fri, 17 Apr 2020 05:32:55 +0000 (07:32 +0200)
web/Obj/user.phh
web/briskin5/index.php
web/index.php

index d6a4395..d126176 100644 (file)
@@ -605,8 +605,9 @@ class User {
               $sp = " ";
           }
       }
-      return (sprintf('$("myname").innerHTML = "<span class=\"%s\">%s</span>";', $cl,
-                      xcape($this->name,ENT_COMPAT,"UTF-8")));
+      $myname = xcape($this->name,ENT_COMPAT,"UTF-8");
+      return (sprintf('window.myname = "%s"; $("myname").innerHTML = "<span class=\"%s\">%s</span>";',
+                      $myname, $cl, $myname));
   }
 
   /* INDEX_RD PORT */
index 68f6287..6071c73 100644 (file)
@@ -79,6 +79,7 @@ function bin5_index_main($transp_type, $header, &$header_out, $addr, $get, $post
 </head>
 <body>
 <SCRIPT type="text/javascript">
+   var myname = null;
    var sess = "not_connected";
    var xstm = null;
    var g_lang = "<?php echo "$G_lang"; ?>";
@@ -106,6 +107,7 @@ var g_imgct= 0;
 var g_imgtot = g_preload_img_arr.length;
 var g_exitlock = 0;
 
+
 window.onload = function() {
   g_jukebox = new jukebox([{'name': 'cow', 'file': 'cow.mp3'},
                            {'name': 'rooster', 'file': 'rooster.mp3'},
index 6e6d50a..70b0dae 100644 (file)
@@ -1043,6 +1043,7 @@ supported by:<br>
 <link rel="stylesheet" type="text/css" href="room.css">
 
 <script type="text/javascript"><!--
+var myname = null;
 var g_debug = 0;
 var g_lang = "<? echo $G_lang; ?>";
 var g_lng = "<? echo $G_lng; ?>";