How to hidden javascript code in Blogger from inspect page element?

青春壹個敷衍的年華 提交于 2019-12-02 01:43:56

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/18683029/how-to-hidden-javascript-code-in-blogger-from-inspect-page-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!