2

I am trying to hide some javascript code from inspect page element.

For example I have HTML widget as:

<b:section class='sidebar1' id='sidebartab1' preferred='yes'>
<b:widget id='HTML1' locked='false' title='HTML' type='HTML'>
<b:includable id='main'>
                          <!-- only display title if it's non-empty -->
                          <b:if cond='data:title != &quot;&quot;'>
                            <h2 class='title'>
                              <data:title/>
                            </h2>
                          </b:if>
                          <div class='widget-content'>
                            <data:content/>
                          </div>
                          <b:include name='quickedit'/>
                        </b:includable>
</b:widget>
</b:section>

I have input content as :

<script type="text/javascript">
document.write('Hello Stackoverflow');
</script>

The output content will appear on browser is :

Hello Stackoverflow

But I still see javascript code with "inspect element".

So how can I hidden code js in Blogger from inspect page element?

Hai Tien
  • 2,929
  • 7
  • 36
  • 55

1 Answers1

4

Impossible at all.

You've sent a script element to the client. The inspector is running in the same scope with the same permissions as your script.

You can obfuscate it (if you really need to).

Community
  • 1
  • 1
Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79
  • Thanks for your opinion. But i still do not understand why author of this template (http://maxxiz-mkrdezign.blogspot.com/) can get post without javascript in his code. https://lh3.googleusercontent.com/-XgMAHc_1X4w/Uixf5SnolrI/AAAAAAAAGUI/mUrlt-I-Qqk/w865-h324-no/HTML.png – Hai Tien Sep 08 '13 at 11:46
  • 1
    @happi what JavaScript you expect to see? It's there somewhere, just in a different place. – Shadow The GPT Wizard Sep 08 '13 at 12:00
  • Actually, in blogger HTML widget, to get post as my shown picture, I need to use javascript as : . But i do not see anything as that code in above template. – Hai Tien Sep 08 '13 at 12:09