mardi 7 juillet 2015

Insert Javascript Function Value in Partial View

I have a javascript function which returns a value that I am trying to display in a table in my partial view.

In my main view I have something like this:

<script type="text/javascript">
    function myFunc() 
    {
        return "myVal";
    }
</script>

In my partial view html I am trying to do this:

<td><script>document.write(myFunc())</script></td>

The function gets called but it seems to always return undefinted am I doing something wrong here?

Aucun commentaire:

Enregistrer un commentaire