2013-09-09, 04:52 PM
2013-09-09, 04:59 PM
<script type="text/javascript">
document.write('{$multipage}');
</script>
Does that work?
2013-09-09, 05:04 PM
no it doesnt work.
how can i write {$mybb_element} in javascript.
(2013-09-09, 04:52 PM)gnostic Wrote: [ -> ]why blow code is not correct?
<script type="text/javascript"> document.write({$multipage}); </script>
output is :
);
what is the correct format ?
how can i write {$mybb_element} in javascript.
2013-09-10, 02:00 PM
Can you post an extract of the HTML output?
2013-09-10, 02:12 PM
the output is :
this error get because i use {$welcomeblock}\, i dont khow how can show {$welcomeblock} in javascript.
i use php echo command too, but i get above error.
this error get because i use {$welcomeblock}\, i dont khow how can show {$welcomeblock} in javascript.
i use php echo command too, but i get above error.
2013-09-10, 02:21 PM
You're not escaping the string. You need to put a backslash before each single quote.
2013-09-10, 02:37 PM
in header template :
i want, when my condition is true,{$welcomeblock} apear and else no apear.
but blow code is not correct :
and output of above code is :
this error get because i use {$welcomeblock}, i dont khow how can show {$welcomeblock} in javascript.
i use php echo command too, but i get above error.
i want, when my condition is true,{$welcomeblock} apear and else no apear.
but blow code is not correct :
<script type="text/javascript">
if (my condition is true)
{
{$welcomeblock}
}
else
{
}
</script>
and output of above code is :
this error get because i use {$welcomeblock}, i dont khow how can show {$welcomeblock} in javascript.
i use php echo command too, but i get above error.
2013-09-11, 04:18 PM
developers plz help me...
2013-09-11, 07:28 PM
I'm not sure you can actually do what you are trying to do there because you are using a variable in PHP within a section of javascript. PHP is parsed server side while Javascript is client side.