0
variable von php nach javascript (animate) übertragen
Explorer
,
/t5/animate-discussions/variable-von-php-nach-javascript-animate-%C3%BCbertragen/td-p/11143151
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/animate-discussions/variable-von-php-nach-javascript-animate-%C3%BCbertragen/m-p/11143294#M204410
May 19, 2020
May 19, 2020
Copy link to clipboard
Copied
you can't (normally) use php tags in a js file. php is a server-side language and js is client-side.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

