Hi,
The reason for this is that you are replacing the buttons when you update
the answer. The event listener that you attached is on the first one and
not the second one.
You can solve this in 2 ways:
1. Reregister the event listener when you have loaded the answer again.
2. Use a different way
My problem is that site registers only the first click on .upvote or
.downvote element and ignores next ones.
{% extends 'base.html' %}
{% load votes_exists %}
{% block title %}{{question.title|truncatechars:52}}{% endblock %}
{% block content %}
{{question.title}}
{{question.content}}
{% for
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
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".
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
t; '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
> (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 versi
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
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
May be there is something simpler than Ajax request?
четверг, 10 марта 2016 г., 14:20:17 UTC+2 пользователь Sergiy Khohlov
написал:
>
> Ajax ?
> Have you checked this one ?
>
> Many thanks,
>
> Serge
>
>
> +380 636150445
> skype: skhohlov
>
> On Thu, Mar 10, 2016 at 2:18 PM,
Ajax ?
Have you checked this one ?
Many thanks,
Serge
+380 636150445
skype: skhohlov
On Thu, Mar 10, 2016 at 2:18 PM, wrote:
> I had method model that generate dict, sample:
>
> {
> 'translators': 5,
> 'glossaries': 1,
> 'abbrs': 0,
> }
>
> I want
I had method model that generate dict, sample:
{
'translators': 5,
'glossaries': 1,
'abbrs': 0,
}
I want known, how transfer data without hidden fields in html file. I need
here for generate google-chart.
--
You received this message because you are subscribed to the Google Groups
You pretty much answered it yourself.
>there's just one actual html page and inside it we have to create a page
(data-role="page")
Django's template helps you put together the response that gets to the
client. It's unaware of what your CSS and Javascript frameworks will do
with that response.
g
features with jquery mobile? Or how to django with jquery mobile? Please
help me understand this concept. Thank you.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
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
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
Hi
maybe you need find in google.com for example
http://fromzerotocodehero.blogspot.com/2011/01/django-ajax-tutorial-part-1.html
I think there are more tutorials
Cheers,
On Thu, Aug 15, 2013 at 6:09 AM, Scheck Nyori wrote:
> Hello!
> I am a noob in web development.
Hello!
I am a noob in web development. Just finished polls tuts. Can anyone give
me any insight in using jquery and ajax with django! If possible any
tutorial. Any help will be appreciated!
Thank you.
--
You received this message because you are subscribed to the Google Groups
"Django users"
:
>
> Hello,
> I am totally helpless. I am trying to use JQuery in my django
> templates, but I always get in firebug this: $ not defined.
>
> In my template I am linking jquery :
>
>
> And then
>
> $(document).ready(function() {
> alert("Hello from
I'm having this problem at the moment too. In our case, it's because we
have a base template that inserts the jQuery library via a script tag
towards the end of the document, just before the close of the body element.
Since anything following a $ character in JS depends on jQuery, including
Someone please give some solution to this stack overflow question-
http://stackoverflow.com/questions/11706721/updating-a-button-value-database-and-call-a-view-function-without-refreshing-th
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
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
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
>
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 < d
On Tue, Nov 23, 2010 at 5:18 PM, Derek wrote:
> In the last Django advent, Zain Memon said:
>
> "A lot of implemented features missed the cut for Django 1.2, like
> drag-and-drop reordering of inlines for models with an ordering field, and
> an autocomplete widget for
In the last Django advent, Zain Memon said:
"A lot of implemented features missed the cut for Django 1.2, like
drag-and-drop reordering of inlines for models with an ordering field, and
an autocomplete widget for Foreign Key and M2M relations to be used instead
of the select drop-down (or
This is useful too: http://www.dajaxproject.com/
On Mon, Jun 7, 2010 at 07:57, Dmitry Dulepov wrote:
> Hi!
>
> tazimk wrote:
>> I want to use ajax in my templates using jquery.
>> Can someone provide me some sample examples /links related to
>> this.
>
>
Hi!
tazimk wrote:
> I want to use ajax in my templates using jquery.
> Can someone provide me some sample examples /links related to
> this.
http://www.google.com/ may be? The question is too broad.
--
Dmitry Dulepov
Twitter: http://twitter.com/dmitryd/
Web: http://dmitry-dulepov.com/
I'll go ahead and insert a plug here:
http://github.com/superjoe30/jst-parser
On Jun 6, 12:14 am, tazimk wrote:
> Hi,
>
> I want to use ajax in my templates using jquery.
> Can someone provide me some sample examples /links related to
> this.
> Also some
Django itself doesn't really care what JS framework you use and only
offers some framework agnostic helpers within the request object like
http://docs.djangoproject.com/en/1.2/ref/request-response/#django.http.HttpRequest.is_ajax
to distinguish requests coming as XHRs as well as
Hi,
I want to use ajax in my templates using jquery.
Can someone provide me some sample examples /links related to
this.
Also some sample examples on using Jquery efficiently
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Hi,
I want to use ajax in my templates using jquery.
Can someone provide me some sample examples /links related to
this.
Also some sample examples on using Jquery efficiently
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
e 28 févr. 2010 à 18:39, Alexis Selves a écrit :
>
> > Hello,
> > I am totally helpless. I am trying to use JQuery in my django
> > templates, but I always get in firebug this: $ not defined.
>
> Did you try with 'jQuery' instead of '$' ?
> If jQuery.no_conflict() was
Le 28 févr. 2010 à 18:39, Alexis Selves a écrit :
> Hello,
> I am totally helpless. I am trying to use JQuery in my django
> templates, but I always get in firebug this: $ not defined.
Did you try with 'jQuery' instead of '$' ?
If jQuery.no_conflict() was called, the $ variable isn'
Alexis Selves wrote:
> Hello,
> I am totally helpless. I am trying to use JQuery in my django
> templates, but I always get in firebug this: $ not defined.
>
> In my template I am linking jquery :
>
>
>
where do you have your static files? did you serve them as sta
On Sun, Feb 28, 2010 at 5:39 PM, Alexis Selves <petr.pej...@gmail.com>wrote:
> Hello,
> I am totally helpless. I am trying to use JQuery in my django
> templates, but I always get in firebug this: $ not defined.
>
Check with Firebug if the jquery script has been successfully lo
Hello,
I am totally helpless. I am trying to use JQuery in my django
templates, but I always get in firebug this: $ not defined.
In my template I am linking jquery :
And then
$(document).ready(function() {
alert("Hello from jQuery");
});
But I always get nothing..
us
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
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', {})
> > 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,
Ok, I will try this way.
Thank a lot!
On Feb 5, 11:50 pm, Daniel Roseman <roseman.dan...@googlemail.com>
wrote:
> On Feb 5, 12:19 pm, min <inuyasha...@gmail.com> wrote:
>
>
>
>
>
> > Hi, everyone.
>
> > I'm learing Django now. Currently, I have a p
On Feb 5, 12:19 pm, min <inuyasha...@gmail.com> 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
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 = TestForm
On 12 Lug, 08:42, Przemek Gawronski <[EMAIL PROTECTED]>
wrote:
> Hi, any one willing to share some examples of django newforms with
> jQuery?
Few months ago I posted on djangosnippets.org a widget that uses the
jquery autocomplete plugin written by Jörn Zaefferer, have a
Przemek Gawronski wrote:
>
> What I'm looking for now is, how to redirect to a different page with
> the button, and sending to the page (django view) the id number.
>
> Przemek
If you don't want to use ajax you can either use a form as normal to
submit it and then issue a redirect at the
> I'm assuming that you want to use some form a AJAX type request/response
> for this?
Well, once I'll feel comfortable with django and js, then probably, but
not at the moment.
> As an outline you might want to do something like this:
> Display your list as a table
> Use your workorder id
Przemek Gawronski wrote:
> I want to show to the user a list of workorders with the possibility
> to select one (probably I should use a radio button for that), above
> the list are a couple of buttons that allow to display some extra
> information for the selected workorder like a list of time
> I have no idea what you're trying to do with your form,
How about something like this: in my model I've got a class Workorder,
with some info about it. For the Workorder there are time sheets,
printouts and some other objects.
I want to show to the user a list of workorders with the
> This__ isn't interesting, but it *is* an example. :-)
> .. __: http://groups.google.com/group/django-users/msg/c8f7d18eb79d9aa1
It's definitely a start, thanks!
Przemek
--
AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin
info: http://www.tanren.pl/ phone: +4850151
> Well, in general, I'm pretty new to web development including javascript
> (but with 7 years of python coding) so I just wanted to see what (and
> how) people do newforms and jQuery to get the idea.
This__ isn't interesting, but it *is* an example. :-)
.. __:
Well, jquery is just a framework for javascript, much like Django is a
framework for python. So the real question is, what are you trying to
do... validation? Hide and show elements? Send ajax requests back and
forth? Without knowing what you're trying to do, I can't really help.
On Jul 12, 2:28
> I have no idea what you're trying to do with your form, but I've used
> jquery and newforms together. Without knowing waht you're trying to
> do, I can't give any specific advice or tips, but at the most basic
> level, you just grab the element you want: $("#id_foo") and you're on
> your way.
I have no idea what you're trying to do with your form, but I've used
jquery and newforms together. Without knowing waht you're trying to
do, I can't give any specific advice or tips, but at the most basic
level, you just grab the element you want: $("#id_foo") and you're on
your way.
On Jul
> What do you mean? Perhaps you should go to the jQuery-EN group and
> look for examples of form manipulation there.
Thanks, I'll do that!
Przemek
--
AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin
info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED]
What do you mean? Perhaps you should go to the jQuery-EN group and
look for examples of form manipulation there.
J
On Jul 12, 7:42 am, Przemek Gawronski <[EMAIL PROTECTED]>
wrote:
> Hi, any one willing to share some examples of django newforms with
> jQuery?
>
> Thanks in ad
Hi, any one willing to share some examples of django newforms with
jQuery?
Thanks in advance!
Przemek
--
AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow - Ursynow - Natolin
info: http://www.tanren.pl/ phone: +4850151 email: [EMAIL PROTECTED
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
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:
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
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
60 matches
Mail list logo