Re: Ajax and Django and jQuery - .attr()

2020-05-31 Thread meli...@melindaminch.com
Hello! To answer the question about template tags in javascript, i.e. $.post("{% url 'upvote' %}", {answer_id:answerid}) I This works when your js is written in the template, as you have it, but if you ever want to move that JavaScript into a separate .js file, it will break. That’s because ri

Re: Ajax and Django and jQuery - .attr()

2020-05-31 Thread Stephen J. Butler
This isn't a jQuery issue, it's a JavaScript/ECMAScript issue. When you use the "arrow function" style like "() => { ...code... }" then certain variables are not bound into the function contact, including "this". https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_func

Ajax and Django and jQuery - .attr()

2020-05-31 Thread Jan Gregorczyk
I have a problem with Ajax and Django templates. I'm new to Ajax and jquery. Console log at the end of the script prints undefined. I don't know why let answerid = $(this).attr("answer-id"); doesn't extract attribute from this line: ↑ I also want to know if using template tags in javascript scri

Re: Django and jQuery, I don't get it

2016-06-10 Thread Stephen J. Butler
Specifically, this style is called an Immediately Invoked Function Expression, or IIFE. https://en.wikipedia.org/wiki/Immediately-invoked_function_expression On Fri, Jun 10, 2016 at 3:36 AM, ludovic coues wrote: > > (function($) { > > 'use strict'; > > > > })(django.jQuery); > > Th

Re: Django and jQuery, I don't get it

2016-06-10 Thread ludovic coues
> (function($) { > 'use strict'; > > })(django.jQuery); This syntax is called a closure. First you declare a function so you don't contaminate the global scope with your local declared variable. Then you execute your function. I will assume django.JQuery is the version of JQuery shipp

Re: Django and jQuery, I don't get it

2016-06-09 Thread Mike Dewhirst
I can't help at all with jquery but IIRC there is a question in the Admin "Are you sure?" when you try deleting something from a list view. Might be a start Mike On 10/06/2016 1:06 AM, Olivier Dalang wrote: Hi ! I'm using several modules that rely on jQuery, and have some own needs as well :

Django and jQuery, I don't get it

2016-06-09 Thread Olivier Dalang
Hi ! I'm using several modules that rely on jQuery, and have some own needs as well : - admin > - grappelli > - autocomplete light > - session security > ... I also see that there are tons of different variables that reference jQuery, defined by theses modules, some of which are the same, and s

Re: Django and Jquery UI

2015-05-20 Thread Joris
Hi Robert Could you please specify more clearly how you "added jqueryui to my settings.py" ? It should be handled like any other static file and doesn't really have a place in settings.py Do your other static files (images, css, etc) load? Best Seems tough to get the Jquery UI code to do an

Django and Jquery UI

2015-05-19 Thread Robert librado
Seems tough to get the Jquery UI code to do anything like on Jquery.com Im using there demos just to get my feet wet ive already added jqueryui to my settings.py I already did collectstatic I added the draggable demo to an html template created the view it shows on the page but does not allow me

django and jquery data grids

2012-06-25 Thread rafiee.nima
Hi I want to know what is the most compatible and straight forward jquery data grid plugin for django and also how I can integrated jqgrid with django -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: django and jquery

2012-06-11 Thread Lee Hinde
On Jun 11, 2012, at 11:51 AM, cocoza4 wrote: > i tried to retrieve data from django to jquery by using get > > this is my $get in jquery > > $.get("/video/", > { > video_page: page_number > }, > function(data){ >

django and jquery

2012-06-11 Thread cocoza4
i tried to retrieve data from django to jquery by using get this is my $get in jquery $.get("/video/", { video_page: page_number }, function(data){ for (var i = 0; i < data.length; i++){

Re: Django and jQuery trouble

2009-02-10 Thread Antoni Aloy
2009/2/10 min : > > Hi, everyone. > > I have a question for the following example. > > Firstly, in the view.py: > > def test_1(request, zipcode, pro): > if zipcode == 'a' and pro == 'b': >city = 'c' > else: >city = '' > > return HttpResponse(city) > > def test_0(request): > return rend

Django and jQuery trouble

2009-02-09 Thread min
Hi, everyone. I have a question for the following example. Firstly, in the view.py: def test_1(request, zipcode, pro): if zipcode == 'a' and pro == 'b': city = 'c' else: city = '' return HttpResponse(city) def test_0(request): return render_to_response('test_0.html', {}) -

Re: Trouble with Django and jQuery

2009-02-06 Thread varikin
> > The external jQuery script doesn't go through Django, so obviously the > > template variables aren't parsed. As you have discovered, you can put > > javascript in the template so that it is parsed. So you already have > > the answer to your question: use a small script within your template, >

Re: Trouble with Django and jQuery

2009-02-05 Thread min
Ok, I will try this way. Thank a lot! On Feb 5, 11:50 pm, Daniel Roseman wrote: > On Feb 5, 12:19 pm, min wrote: > > > > > > > Hi, everyone. > > > I'm learing Django now. Currently, I have a problem with Django and > > jQuery. The detail is that:

Re: Trouble with Django and jQuery

2009-02-05 Thread Daniel Roseman
On Feb 5, 12:19 pm, min wrote: > Hi, everyone. > > I'm learing Django now. Currently, I have a problem with Django and > jQuery. The detail is that: > > Firstly, I have a form in the forms.py: > > class TestForm(forms.Form): >     name = forms.CharField( max_lengt

Trouble with Django and jQuery

2009-02-05 Thread min
Hi, everyone. I'm learing Django now. Currently, I have a problem with Django and jQuery. The detail is that: Firstly, I have a form in the forms.py: class TestForm(forms.Form): name = forms.CharField( max_length=30 ) Then, in the views.py: def Test_page(request): form = Tes

Re: Django and jQuery Autocomplete Routing Help

2007-03-08 Thread limodou
On 3/9/07, johnny <[EMAIL PROTECTED]> wrote: > > I am new to python and javaScript, I have created a funtion that > return the tags via ajax. I tried to replicate the php example. But > it's not working. I doesn't return any tags back to my html page via > ajax. I need some help. I am using j

Re: Django and jQuery Autocomplete Routing Help

2007-03-08 Thread johnny
I am new to python and javaScript, I have created a funtion that return the tags via ajax. I tried to replicate the php example. But it's not working. I doesn't return any tags back to my html page via ajax. I need some help. I am using jQuery autocomplete plugin from here: http://just-tech.

Re: Django and jQuery Autocomplete Routing Help

2007-03-05 Thread limodou
On 3/6/07, johnny <[EMAIL PROTECTED]> wrote: > > I am using jQuery to do the autocomplete. Autocomplete request > backend script like this: script_url?q=foo. But there is a problem > with django routing? > > (r'^tag/autocomplete/?q=(?P\w+)/$', > 'apps.tag.views.tag_autocomplete'), > > Here is m

Django and jQuery Autocomplete Routing Help

2007-03-05 Thread johnny
I am using jQuery to do the autocomplete. Autocomplete request backend script like this: script_url?q=foo. But there is a problem with django routing? (r'^tag/autocomplete/?q=(?P\w+)/$', 'apps.tag.views.tag_autocomplete'), Here is my error: [05/Mar/2007 15:11:51] "GET /tag/autocomplete/?q=a