Kevin Mansel
Kevin Mansel

Reputation: 2371

Lift - JE.Call() question

Could someone explain why this isn't working for me? I am just trying to run a javascript function on a page that is already defined. This is a basic alert command.

//On html page

<script type="text/javascript">
    function test(){
        alert('hi');
    }
</script>

//on lifty page
JE.Call("test")

I've stripped out a lot of the html/lift/scala code for the sake of the question. For some reason, this will not call the js function in the html page, either on of the page or when say, an ajaxButton function is called. I'm just trying to interact with the javascript on the html page. I must be missing a key detail?

Thanks!

Upvotes: 0

Views: 741

Answers (1)

pr1001
pr1001

Reputation: 21962

First, how are you returning the Call? Do you have an AJAX or Comet snippet on the page that will return that?

Second, are you sure that your test function is in the global scope such that the Call can, well, call it?

Related, what does your browser's Javascript console say? Are there any Javascript errors? That might indicate that test is not defined in the right scope. Do you see any network activity? If no then then the server-side part that would return the Call is not getting activated.

PS I was the last person to touch Call's ScalaDocs and can update them again if you think they aren't sufficient.

Upvotes: 1

Related Questions