Add a <?php text ?> in a code -
i have code
if(!document.getelementbyid('slider_cmp')) { var tooltip = document.createelement("div"); tooltip.classname = "cmp_tips"; tooltip.id = "cmp_tips"; tooltip.style.position = "absolute"; tooltip.style.top = '145px'; tooltip.style.left = '50px'; tooltip.style.display = "none"; tooltip.style.zindex = 9999; tooltip.innerhtml = "i need text here"; document.body.appendchild(tooltip); var sliderdiv = document.createelement("div"); sliderdiv.classname = "slide-out-div"; sliderdiv.id = "slider_cmp"; sliderdiv.style.display = "none"; var handler = '<div id="clickme"></div><div id="slidecontent"></div>'; sliderdiv.innerhtml= handler; document.body.appendchild(sliderdiv); if(cmplastcat > 0) {
i need put <?php echo ?>
instead of "i need text here"
in code... can please me?
thank you.
if javascript within in php-file, do:
tooltip.innerhtml = "<?php echo $somevariabletoprint; ?>";
the php-snippet evaluated on server prior sending page client, client recieves is:
tooltip.innerhtml = "the text in variable";
update
based on additional info given in comment, code be:
tooltip.innerhtml = "<?php echo cbtxt::_('text here'); ?>";
Comments
Post a Comment