I have a controller code like this :
def test23() {
//params.id23 is been passed via ajax calls
def find = User.findByUsernameLike("${params.id23}")
println find
render """<script type="text/javascript"> alert("hi"); </script>"""
}
This code is called using jquery’s ajax method. Well, it works well, that is , I get output printed on my console, but the render part is not working (I’m not getting the alert).
What I done is correct? Or anything else need to be passed to render those scripts?
try this instead:
or possibly: