![]() |
Javascript calling smarty - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Javascript calling smarty (/showthread.php?tid=59343) |
Javascript calling smarty - El Forum - 09-23-2013 [eluser]Unknown[/eluser] Hi, i'm doing some modification on script using smarty 2 , i have 2 question 1-javascript loading partial tpl file 2-javascript calling a variable from tpl file / i have page detail.tpl that use ( header.tpl , player.tpl, footer.tpl ) normaly he was inclued on other tpl like this Code: {include file="player.tpl" page="detail"} but i want to call "player.tpl" in a javascript when i click he replace picture by player the code working expet that the player dont want to apear Code: playVideo : function(id, videoPageUrl) what did i must write in the "file.js" to let it call the player.tpl when i exute the function ? did i must add some ligne ? or changinng the path ? Javascript calling smarty - El Forum - 09-23-2013 [eluser]Unknown[/eluser] 2nd question: is calling variable on tpl to be used on javascript function when i put the function on the .tpl ( internal script) it work but on javascript external i do'nt have idea the variable shall be the same as in the tpl or in the php file for example Code: {literal} [removed] the external js using this (internal scxript) is working but when i want to add it to the same js !!! i do'nt know how to call the variable used on the details.tpl this varible{$video_link} Code: function autoPostToFeed(url) { --------------------------------------------------------- same thing for another varible on tpl Code: {$facebook_image_src } on php Code: $facebook_image_src = show_thumb($video['uniq_id']); on external js i testest many but still not working ? Code: var poster = '' |