为什么我的以下小提琴在没有任何打印调用的情况下给出输出

why my following fiddle giving output without any print call?

本文关键字:调用 打印 情况下 输出 任何 我的 小提琴 为什么      更新时间:2023-09-26

我有一段代码是:

<script type="text/javascript"><!--
google_ad_client = "ca-pub-8514414755716493";
/* AdX_Washington_Examiner */
google_ad_slot = "9465392777";
google_ad_width = 320;
google_ad_height = 50;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

为什么这段代码给出的输出是"}//]]>"?

我没有写任何打印调用,但它仍然提供输出。.

这是我的小提琴链接 http://jsfiddle.net/akshaynikte/ryLPf/6/#

以下是

jsFiddle文档页面的一些摘录:

JavaScript面板

在此面板中输入的代码将放置在标头的脚本块中, 那是在<script type="text/javascript"></script>之间。

Add Resources部分

CSS或JS(带有适当的扩展名),应该在之后加载 框架。这是放置图书馆的理想场所 独立于框架,如RaphaelJS

因此,使用问题中的脚本的正确方法是:

  1. 将以下内容添加到JavaScript面板。

    <!--
        google_ad_client = "ca-pub-8514414755716493";
        /* AdX_Washington_Examiner */
        google_ad_slot = "9465392777";
        google_ad_width = 320;
        google_ad_height = 50;
    -->
    
  2. http://pagead2.googlesyndication.com/pagead/show_ads.js添加到页面左侧的Add resources部分。

下面是指向正确配置的示例的链接:http://jsfiddle.net/edywd/。

这似乎是小提琴手上的一个错误(或者它不允许在javascript面板上script标签),如果您将脚本更改为其他任何内容,您将看到它发生相同。

您应该将脚本放在HTML面板上,根据我的测试,该面板工作正常。

<script type="text/javascript"><!--
google_ad_client = "ca-pub-8514414755716493";
/* AdX_Washington_Examiner */
google_ad_slot = "9465392777";
google_ad_width = 320;
google_ad_height = 50;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

你不能在JSFIDDLE的js textArea中使用脚本标签,它只有JS,如果你想使用脚本标签,把它们放在JSFIDDLE的html文本区