title: javascript append in Php echo?
body: <p>I try to append something to a div over a Php echo</p>
  
  <p>Includes</p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Php Code </p>
  
  <pre><code>&lt;?php echo "&lt;script type='text/javascript' &gt;$('.notificationsBody').prepend('Hello World');&lt;/script&gt;"; ?&gt;
  </code></pre>
  
  <p>My Div Code </p>
  
  <pre><code>&lt;div class="notificationsBody"&gt;TESTING DIV&lt;br&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Is this possible and if yes why isnt this working ? My Console is empty too. 
  If not is there a other way to realize a Div appending over a Php Echo ? </p>
  
  <p>Hint: I need a Php echo if its possible. </p>
  
  <p>This is my complete index.php Page </p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  
          "http://www.w3.org/TR/html4/loose.dtd"&gt;
  
  
  
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="content-type" content="text/html; charset=utf-8"&gt;
      &lt;title&gt;Test&lt;/title&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  
  &lt;?php echo "&lt;script type='text/javascript' &gt;$('.notificationsBody').prepend('Hello World');&lt;/script&gt;"; ?&gt;
  &lt;div class="notificationsBody"&gt;TESTING DIV&lt;br&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>What i want at the end is like you have a Class and call the Function </p>
  
  <pre><code>&lt;?php echo $myclass-&gt;theechofunction(); ?&gt;
  </code></pre>
  
  <p>Then this will echo the Javascript which appending a Div to my Wrapper. </p>
  
  <p>Yes its a bit crazy / difficult but thats what i need.</p>
  
  <p>Thanks for every Answer.</p>
  
  <p>EDIT </p>
  
  <p>The Site Quellcode after calling the site</p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
  
  
  
  &lt;script type='text/javascript' &gt;$('.notificationsBody').prepend('Hello World');&lt;/script&gt;
  
  &lt;div class="notificationsBody"&gt;TESTING DIV&lt;br&gt;&lt;/div&gt;
  </code></pre>