Daniel Fischer: " " Anführungszeichen in JS Textarea setzt diese ausser Kraft?

Beitrag lesen

Hi,

nachfolgend zu meinem anderen Problem im anderen Thread das sich erledigt hat, habe ich jetzt ein neues verheerendes Problem ...

********************************************

<html>
<head><title>TESTEN TESTEN TESTEN</title>
<script language=JavaScript>
function HoleHttpGetWert(NameDerVariablen){
 var httpget = unescape(self.location.search);
 var Wert  = ""
 if (httpget != '')
  {
 httpget = httpget.substr(1, httpget.length - 1);
 teile = httpget.split('&');
 for (i = 0; i < teile.length; i++)
 {
   teile[i] = teile[i].split('=');
   if (teile[i][0]==NameDerVariablen)
   {
  Wert=teile[i][1];
  while(Wert.match(/+/)){
   Wert=Wert.replace(/+/," ");
  }

}
 }
  }
 return(Wert);
}
function generate() /* Generation of "Compilation" */
 {
  code = document.pad.text.value;
  if (code)
   {
 document.pad.text.value='Compiling...Please wait!';
 setTimeout("compile()",1000);
   }
  else alert('First enter something to compile and then press CompileIt')
 }
function compile() /* The "Compilation" */
 {
  document.pad.text.value='';
  compilation=escape(code);
  document.pad.text.value="<script>\n<!--\ndocument.write(unescape(""+compilation+""));\n//-->\n</script>";
  i++;
  if (i=1) alert("Page compiled 1 time!");
  else alert("Page compiled "+i+" times!");
 }
function selectCode() /* Selecting "Compilation" for Copying */
 {
  if(document.pad.text.value.length>0)
   {
 document.pad.text.focus();
 document.pad.text.select();
   }
  else alert('Nothing for be selected!')
 }
function preview() /* Preview for the "Compilation" */
 {
  if(document.pad.text.value.length>0)
   {
 pr=window.open("","Preview","scrollbars=1,menubar=0,status=0,width=840,height=620,left=100,top=60");
 pr.document.write(document.pad.text.value);
   }
  else alert('Nothing for be previewed!')
 }
function uncompile() /* Decompiling a "Compilation" */
 {
  if (document.pad.text.value.length>0)
   {
 source=unescape(document.pad.text.value);
 document.pad.text.value=""+source+"";
   }
  else alert('You need compiled code to uncompile it!')
 }
// -->
</script>
<!-- Compilation Panel -->
<form method=post name=pad align=center><br><br>
<p align="center">
<textarea ID="MyArea" rows=10 name=text cols=50 style="background-color: #DEEFF7; width: 500; height: 100">
</textarea><br>
</form>

<!-- HIER WIRD DER WERT IN DIE TEXTAREA GESCHRIEBEN -->
<script type="text/javascript">
document.pad.MyArea.value="test test test";
</script>

<center>
<form name="select">
<input type="button" style="cursor:hand" value="Kopieren" name="select" onClick="selectCode();document.execCommand('Copy')">

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="button" style="cursor:hand" value="Vorschau" name="B1" onClick="preview()";> </center>
</form>

</td>
</tr>
</table>

</center>
</BODY>
</html>
[/code]

Also wie gesagt wenn ich in der JS Textarea  (MyArea) was mit " " sowie zum beispiel :

[code]
<font size="5">

***********************************************

Dann setz ich diese damit ausser kraft ... :(
HTML muss dadrin aber korrekt gehen, kann mir demnach bitte einer helfen ???

Vielen dank im vorraus !

Daniel Fischer