Tuesday, March 29, 2011

Re: A very simple dajax code to show alert window not working

Thanks Jorge. Worked perfectly. 
I included jquery.dajax.core.js and jquery.js in the document and now everything works perfectly.

btw, I couldnt find documentation for Dajax.process method. Like there there might me other methods too. Where can I find the documentation for them.

On Wed, Mar 30, 2011 at 1:01 AM, Jorge Bastida <neo2001@gmail.com> wrote:
Hi,

You should include your desired Dajax implementation. You can choose between Prototype, jquery, dojo etc...

The django-dajax installation steps are here [1]. As you can see in one of the final steps "Include dajax in your <head>", you should add a new script line to include that JS, also you should include that JS Framework :)

<script src="{{ MEDIA_URL }}/js/prototype.dajax.core.js.js" type="text/javascript" charset="utf-8"></script>

Hope this help you.

Regards.



2011/3/29 Abhijeet Rastogi <abhijeet.1989@gmail.com>
Hi,

I am beginner in django and dajax. In the process of learning to use dajax I am trying to simply display an alert saying "Foo".


The above code contains 2 input boxes. The first one works but second one says "Dajax is not defined". 
I am not able to figure out what is the issue. 
I tried making the above code using http://www.dajaxproject.com/multiply/ .In that, Dajax.process is send as parameter to function. Where is the documentation for that particular thing?

It would be great if I could get a prompt reply as my project is on hold due to this AJAX stuff. Thanks.

My ajax.py looks like:
def showalert(request):
        dajax = Dajax()
        dajax.alert("foo")
        return dajax.json()

And relevant template code is 
function alertshow(){
   Dajaxice.example.showalert(Dajax.process)
   }
<input type="button" name="rand" value="Show alert!" id="rand" onclick="alertshow()"> 

--
Regards,
Abhijeet Rastogi (shadyabhi)
http://www.google.com/profiles/abhijeet.1989

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Regards,
Abhijeet Rastogi (shadyabhi)
http://www.google.com/profiles/abhijeet.1989

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment