I recommend putting it into a separate javascript file, and serve it via /static/script.js, and including it in the html with a <script src="/static/script.js"></script>
On Feb 3, 3:11 am, "Dr. Loboto" <[email protected]> wrote: > Better way in this case is to replace all $ calls by jQuery ones: > > jQuery(document).load(function(){ > jQuery(".add_content_here form").hide > (); > }); > jQuery(document).ready(function(){ > jQuery > (".add_content_here .expand").click(function(event){ > event.preventDefault(); > jQuery(".add_content_here > form").toggle("slow"); > jQuery(".add_content_here > span.label").toggleClass("activated"); > }); > > It will also make your code compatible with other JS libraries if > you'll need them in future by some reason > (http://docs.jquery.com/Using_jQuery_with_Other_Libraries) > > On Feb 3, 12:13 pm, alecwh <[email protected]> wrote: > > > Hello list, > > > I'm trying to run several javascript (specifically jQuery) files > > through the the web.py filtering system, but I'm encountering an > > obvious problem: jQuery uses the '$' sign a lot. And that also the > > sign that the web.py templator system uses... which means I would need > > to escape all the dollar signs, like in this example: > > > $(document).load(function(){ > > $(".add_content_here form").hide(); > > }); > > $(document).ready(function(){ > > $(".add_content_here > > .expand").click(function(event){ > > event.preventDefault(); > > $(".add_content_here > > form").toggle("slow"); > > $(".add_content_here > > span.label").toggleClass("activated"); > > }); > > > Is there any solution to this problem? I really don't want to escape > > all the dollar signs as I'm sure there is a better way to do it. Any > > help is greatly appreciated! > > -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.
