a ] is missing
the selector is $('[something]') while you're instead using $('[something')

On Saturday, December 14, 2013 6:27:56 AM UTC+1, Doug Hauenstein wrote:
>
> Massimo,
>
> My syntax appears to be identical to yours but..
> Firebug is telling me I have a syntax error as follows.
>
> Error: Syntax error, unrecognized expression: [data-direction=up
> http://127.0.0.1:8000/reddit_clone/static/js/jquery.js
> Line 3
>
> I am using web2py 2.8.2 python 2.73
>
> I attached list_posts_by_votes.html
>
> <script>
> function do_ajax_vote(t,direction)  {
>    alert('clicked');
> }
>
> jQuery(function()  {
>   jQuery('[data-direction=up').click(function(){do_ajax_vote(this,'up');});
>   
> jQuery('[data-direction=down').click(function(){do_ajax_vote(this,'down');});
> });
> </script>
>
> On Friday, December 13, 2013 8:38:24 PM UTC-5, Massimo Di Pierro wrote:
>>
>> JQuery should be jQuery
>>
>> On Friday, 13 December 2013 15:30:06 UTC-6, Doug Hauenstein wrote:
>>>
>>> I am following the week 3 video and trying to learn by doing so I am 
>>> trying to duplicate the application as presented in the video.
>>>
>>> Do I have to initialize jQuery or do I have a syntax error???
>>> firebug ooutput:     ===================
>>>
>>> ReferenceError: JQuery is not defined
>>>
>>> http://127.0.0.1:8000/reddit_clone/default/list_posts_by_votes/programming
>>> Line 285
>>> =================================
>>> RE:  list_posts_by_votes.html
>>> adding syntax so the buttons <button data-direction= "up">-</button> 
>>> etc....
>>>
>>> The button action does not work and I get the following error in firebug:
>>>
>>> <script>
>>> function do_ajax_vote(t,direction)  {        <--------- Line 285  
>>> ------->
>>>    alert('clicked');
>>> }
>>>
>>> JQuery(function()  {
>>>   
>>> jQuery('[data-direction=up').click(function(){do_ajax_vote(this,'up');});
>>>   
>>> jQuery('[data-direction=dw').click(function(){do_ajax_vote(this,'dw');});
>>> });
>>> </script>
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to