页面源中不可见Smarty的JavaScript输出

页面源中不可见Smarty的JavaScript输出,javascript,smarty,output,Javascript,Smarty,Output,我目前正在对使用Smarty引擎的页面进行一些更改。我对输出JavaScript感到困惑,因为当我查看页面源代码时,没有输出任何内容,但当我使用Firebug时,输出的JavaScript代码是可见的。Smarty模板是否正常 <script type="text/javascript"> if (isThanksPage == true) {ldelim} var biJsHost = (("https:" == document.location.protocol

我目前正在对使用Smarty引擎的页面进行一些更改。我对输出JavaScript感到困惑,因为当我查看页面源代码时,没有输出任何内容,但当我使用Firebug时,输出的JavaScript代码是可见的。Smarty模板是否正常

<script type="text/javascript">
   if (isThanksPage == true) {ldelim}
     var biJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
     document.write('some javascript source code');
   {rdelim}

   if (isThanksPage === true) {ldelim}
      Order.SetCustomer('{$customerInfo.accountDetails.loginMail}', '{$customerInfo.shippingDetails.sFName}', '{$customerInfo.shippingDetails.sLName}');
      Order.OrderNumber = '{$orderId}';
      Order.OrderTotal = '{$totalAll|string_format:"%.2f"}';
      Order.ShippingTotal = '{if $shippingInfo.value eq 0}Free{else}${$shippingInfo.value|string_format:"%.2f"}{/if}';
   {rdelim}
</script>
      {assign var=totalWithoutTax value=`$total+$shippingInfo.value`}
      {if $tax}
        {assign var=taxValue value=`$tax*$totalWithoutTax/100`}
      {else}
        {assign var=taxValue value=0}
      {/if}
   {assign var=totalAll value=`$totalWithoutTax+$taxValue+$promoProduct.catalog_price`}
<script type="text/javascript">
   if (isThanksPage == true) {ldelim}
      Order.ItemTotal = '${$totalAll|string_format:"%.2f"}';      
   {rdelim}
</script>
      {foreach from=$cartProducts key=key item=product}
         {if $product.freeItemNum}
            <script type="text/javascript">
               if (isThanksPage == true) {ldelim}
               Order.AddLineItem('{$product.productInfo[1]}', {$product.freeItemNum}, '0.00');
               {rdelim}
            </script>
         {/if}

         {if $product.quantity > $product.freeItemNum}
            {assign var=quantity value=`$product.quantity-$product.freeItemNum`}
            {if $product.getYInfo.discountNumber >= $quantity}
               {assign var=priceValue value=`$quantity*$product.getYInfo.discountPrice`}
               {assign var=unitPriceValue value=`$product.getYInfo.discountPrice`}
            {elseif $product.getYInfo.discountNumber neq 0}
               {assign var=quantity1 value=`$quantity-$product.getYInfo.discountNumber`}
               {assign var=quantity2 value=`$product.getYInfo.discountNumber`}
               {assign var=priceValue value=`$quantity1*$product.sellPrice+$quantity2*$product.getYInfo.discountPrice`}
               {assign var=unitPriceValue value=`$product.sellPrice`}
            {else}
               {assign var=priceValue value=`$quantity*$product.sellPrice`}
               {assign var=unitPriceValue value=`$product.sellPrice`}
            {/if}
            <script type="text/javascript">
            if (isThanksPage == true) {ldelim}
            Order.AddLineItem('{$product.productInfo[1]}', {$quantity}, '${$priceValue|string_format:"%.2f"}');
            {rdelim}
            </script>
         {/if}
      {/foreach}
      <script type="text/javascript">
      if (isThanksPage == true) {ldelim}
      Order.Go();
      {rdelim}   
</script>

如果(isThanksPage==true){ldelim}
var biJsHost=((“https:==document.location.protocol)?“https://”“http://”);
write('somejavascript源代码');
{rdelim}
如果(isThanksPage==true){ldelim}
SetCustomer({$customerInfo.accountDetails.loginMail},{$customerInfo.shippingDetails.sFName},{$customerInfo.shippingDetails.sLName}');
Order.OrderNumber='{$orderId}';
Order.OrderTotal='{$totalAll |字符串_格式:“%.2f”}';
Order.ShippingTotal='{if$shippingInfo.value eq 0}Free{else}${$shippingInfo.value | string|u格式:“%.2f”}{/if}”;
{rdelim}
{assign var=totalwithout tax value=`$total+$shippingInfo.value`}
{如果$tax}
{assign var=taxValue=`$tax*$totalwithout tax/100`}
{else}
{assign var=taxValue=0}
{/if}
{assign var=totalAll value=`$totalwithout tax+$taxValue+$promoProduct.catalog\u price`}
如果(isThanksPage==true){ldelim}
Order.ItemTotal='${$totalAll | string_格式:“%.2f”}';
{rdelim}
{foreach from=$cartProducts key=key item=product}
{if$product.freeItemNum}
如果(isThanksPage==true){ldelim}
Order.AddLineItem({$product.productInfo[1]},{$product.freeItemNum},'0.00');
{rdelim}
{/if}
{如果$product.quantity>$product.freeItemNum}
{assign var=quantity value=`$product.quantity-$product.freeItemNum`}
{如果$product.getYInfo.discountNumber>=$quantity}
{assign var=priceValue=`$quantity*$product.getYInfo.discountPrice`}
{assign var=unitPriceValue=`$product.getYInfo.discountPrice`}
{elseif$product.getYInfo.discountNumber neq 0}
{assign var=quantity1 value=`$quantity-$product.getYInfo.discountNumber`}
{assign var=quantity2 value=`$product.getYInfo.discountNumber`}
{assign var=priceValue=`$quantity1*$product.sellPrice+$quantity2*$product.getYInfo.discountPrice`}
{assign var=unitPriceValue=`$product.sellPrice`}
{else}
{assign var=priceValue=`$quantity*$product.sellPrice`}
{assign var=unitPriceValue=`$product.sellPrice`}
{/if}
如果(isThanksPage==true){ldelim}
Order.AddLineItem(“{$product.productInfo[1]},{$quantity},${$priceValue | string|u格式:“%.2f”}”);
{rdelim}
{/if}
{/foreach}
如果(isThanksPage==true){ldelim}
Order.Go();
{rdelim}

您能给出代码示例吗?不,这不是正常行为

当你说“不输出任何内容”时,你的意思是在页面源代码中没有可见的Javascript,还是Javascript向页面添加了内容,而该内容在页面源代码中不可见?我想这是我的错。我正在使用别人的代码,所以我不知道它是如何工作的。经过几个小时的阅读和尝试,我发现firebug返回当前html代码,CTRL+U返回hoe页面——如果没有传递任何参数,则返回重定向页面。