jportela (
jportela) wrote in
dw_dev_training2010-07-14 07:27 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Entry tags:
Best way to add jQuery to a page
I've been trying to add jQuery support to the poll pages, and I want to know the best way to do this.
I tried to use
LJ::need_res('js/jquery/jquery-1.3.2.min.js');
in cgi-bin/LJ/Poll.pm render method, and doing this did include the jquery library (at least by navigating the source code, the <script> tag was there). However, it appears that I can't use it in htdocs/js/livejournal.js (I wanted to use the initPolls function, to change the submit event on polls), there seems to be a conflict and the script crashes the first time a $ (jquery) is used.
One way around this would be not use the jQuery library at all, but that would mean I would have to serialize the form myself (not very hard, but the jquery implementation would probably be the best).
Please share your thoughts on this, I may be including the jquery library in a very unorthodox way :)
I tried to use
LJ::need_res('js/jquery/jquery-1.3.2.min.js');
in cgi-bin/LJ/Poll.pm render method, and doing this did include the jquery library (at least by navigating the source code, the <script> tag was there). However, it appears that I can't use it in htdocs/js/livejournal.js (I wanted to use the initPolls function, to change the submit event on polls), there seems to be a conflict and the script crashes the first time a $ (jquery) is used.
One way around this would be not use the jQuery library at all, but that would mean I would have to serialize the form myself (not very hard, but the jquery implementation would probably be the best).
Please share your thoughts on this, I may be including the jquery library in a very unorthodox way :)
no subject
no subject