-2

I am trying to put a value within some javascript code like so:

<?
$page = "test";

echo ('<script id="template-download" type="text/x-jquery-tmpl">
<tr class="template-download{{if error}} ui-state-error{{/if}}">
    {{if error}}
        <td class="name" style="display: none;">${name}</td>
        <td class="size" style="display: none;">${sizef}</td>
.....etc...
            {{if thumbnail_url}}
                <img src="Img/');
                $page;
                echo('.jpg">
            {{/if}}
.....etc....
</script>');
?>

And the end value looks like this:

            {{if thumbnail_url}}
                <img src="Img/.jpg">
            {{/if}}

and it doesn't put the value? What am i missing???

David

1
  • What does the output look like? Commented Sep 9, 2011 at 4:24

2 Answers 2

6

You're not echoing page.

echo $page;
1
  • It's always the silly ones that are the hardest to spot, cos your brain just assumes they're correct :) Commented Sep 9, 2011 at 4:31
2

thats because you're using single quotes so echo doesnt evaluates $vars and like Joe said, particulary $page is not being echoed

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.