• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

variable von php nach javascript (animate) übertragen

Explorer ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

Ich möchte Daten von php nach javascript senden.

Habe im html-datei von Animate die test1.js datei verwandunden.

Dann habe ich die neue html-datei in Animate nachgeladen.

 

 

<! DOCTYPE html> 
<! -
	ANMERKUNGEN:
	1. Alle Token werden in der Vorlage durch das Zeichen '$' dargestellt.
	2. Sie können Ihren Code nur dort schreiben, wo dies erwähnt wird.
	3. Alle Vorkommen vorhandener Token werden durch die entsprechenden Werte ersetzt.
	4. Leerzeilen werden automatisch entfernt.
	5. Entfernen Sie unnötige Kommentare, bevor Sie Ihre Vorlage erstellen.
-> 
< html > 
< Kopf > 
< meta  charset = " UTF-8 " > 
< meta  name = " Authoring-Tool "  Inhalt = " Adobe_Animate_CC " > 
< title > animate_test </ title >
 <! - schreiben Sie Ihren Code hier -> 
< script  src=" https://code.createjs.com/1.0.0/createjs.min.js " > </ script > 
< script src=" animate_test.js " > </ script > 
< script  src=" test1.js " > </ script > 
< script > 
var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;

 

 

 

hier die test1.js :

 

<? php

//localhost/AAA/test1.php
//localhost/AAA/test1_sicherung.php

$ usrname1 = "Max Mustermann";
$ usrname2 = "Dieter Schmidt";

?> 
< script  type = " text / javascript " > 

var usr1 = " <? php echo $ usrname1;?> ";
var usr2 = " <? php echo $ usrname2;?> ";

	// alert (usr1);
	// alert (usr2);
</ script > 

 

 

 Es funktioniert aber nicht !!

Danke vorab

Views

371

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 19, 2020 May 19, 2020

Copy link to clipboard

Copied

LATEST

you can't (normally) use php tags in a js file.  php is a server-side language and js is client-side.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines