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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -