 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
eazytrader Smarty Rookie
Joined: 16 Jul 2010 Posts: 31
|
Posted: Tue Mar 06, 2012 2:20 pm Post subject: Templatevariablen funktionieren nicht bei ajax.load |
|
|
Hallo,
ich lade ein PHP Script per Ajax in meinem Template:
| Code: |
<script type="text/javascript">
function contentloader() {
$("#div").load("product_info.attributes.php");
}
</script>
<div id="div"></div>
|
In der eingebundenen PHP Datei will ich dann das entsprechende Template laden:
| Code: | | $smarty->display('product_info.attributes.tpl'); |
Leider scheint das nicht zu funktionieren.
Das Template wird nicht angezeigt. Bzw. das Template schon, aber ich kann die Variablen aus der product_info.attributes.php nicht verwenden. Die PHP Datei ist aber geladen.
Hat jemand eine Idee?
Gruß und Danke |
|
| Back to top |
|
jacz Smarty Pro

Joined: 13 Nov 2010 Posts: 249
|
Posted: Tue Mar 06, 2012 7:07 pm Post subject: |
|
|
Ist doch ganz logisch - das über Ajax geladene Script hat keinerlei Bezug zu anderen PHP Scripten.
Da musst du eine Zwischenstation wie gleiche Session oder local Storage verwenden. |
|
| Back to top |
|
eazytrader Smarty Rookie
Joined: 16 Jul 2010 Posts: 31
|
Posted: Tue Mar 06, 2012 10:43 pm Post subject: |
|
|
EDIT: Habs verstanden und hinbekommen. Danke für den Anstoß.
Gruß |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|