0

I was following the manual

https://grails.github.io/grails2-doc/2.2.0/guide/single.html#ajax

there it says to put the following tag in head section

<g:javascript library="jquery" />

I created a sample application and a test controller called HomeController. I created index page and put the above tag in the head. When i load the page it throws the following error.

enter image description here

I am finding the error difficult to comprehend. I appreciate any help. Thanks!

kofhearts
  • 3,607
  • 8
  • 46
  • 79
  • 1
    if your `index` page is not using any layout then make sure you have `` at the end of your head and body. And if using layout also make sure you have `` in your layout gsp (same end of head and body) – MKB Mar 13 '20 at 08:18
  • 1
    thanks! was missing in the index file. Now it works! – kofhearts Mar 15 '20 at 04:31

1 Answers1

1

If your index page is not using any layout then make sure you have <r:layoutResources/> at the end of your head and body.

And if using layout, then make sure you have <r:layoutResources/> in your layout gsp (at the end of head and body).

MKB
  • 7,587
  • 9
  • 45
  • 71