# Executing JavaScript

**URL:** <https://forum.radzen.com/t/executing-javascript/5086>\
**Category:** Blazor Server\
**Created:** [September 25, 2020, 12:18pm UTC](https://forum.radzen.com/t/executing-javascript/5086 "2020-09-25T12:18:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kim](https://forum.radzen.com/user_avatar/forum.radzen.com/kim/32/9988_2.png) [@kim](https://forum.radzen.com/u/kim)\
**Post date:** [September 25, 2020, 12:18pm UTC](https://forum.radzen.com/t/executing-javascript/5086/1 "2020-09-25T12:18:27Z")

</div>

Hello Radzen Team!

I'm trying to play a webcam in my server-side Blazor app, using the webcamjs lib.  
This is what's in my .razor page:

```auto
<div id="camera" style="width: 320px; height: 240px;">
      <div></div>
      <video autoplay="autoplay" playsinline="playsinline" style="width: 320px; height: 240px;"></video>
    </div>
    <button @onclick="Play">Play</button>
    @code {
      void Play() {
        JSRuntime.InvokeVoidAsync("play");
      }
    }
```

And this is what I have in the \_Host.cshtml page:

```auto
<script type="text/javascript" src="assets/sdks/webcamjs/webcam.js"></script>
    <script language="JavaScript">
      function play() {  
    Webcam.set({
      width: 320,
      height: 240,
      image_format: 'jpeg',
      jpeg_quality: 90
    });
    Webcam.attach($("#camera") );
      }
  </script>
```

How can I make sure that the .js code is actually being executed?

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [September 25, 2020, 12:29pm UTC](https://forum.radzen.com/t/executing-javascript/5086/2 "2020-09-25T12:29:31Z")

</div>

Hi @kim,

Not sure if this question is related to Radzen - your code contains zero Radzen related code 🙂

Anyway I would use `console.log` to check if a code is executed or not.
