views:

218

answers:

1

Recently I'm learned how to call SIlverlight methods from JavaScript.
All works fine (even in Chrome !).
But in FireFox 3 (3.6.4) registered Page object is undefined.
My Code is very simple

silverlight

[ScriptableMember]
public bool HasFilter()
{
  return true;
}

And in MainPage constructor

public MainPage()
{
  InitializeComponent();
  HtmlPage.RegisterScriptableObject("Page",this);
  LayoutRoot.DataContext = viewModel;
  Loaded += OnLoaded;
}

JavaScript

<head>
<script type="text/javascript">
        function UpdateFilter() {
            var sl = document.getElementById('SilverlightChartControl');
            alert(sl);
            alert(sl.Content.Page.HasFilter());
        }
    </script>
</head>
<body>
<a href="#" id="resize" onclick="UpdateFilter(); return false;">TEST</a>
</body>
A: 

I've converted code to SL4, installed new plugin (4.0.50401.0) and now it works as expected.

Sergey Mirvoda