foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
[personal profile] foxfirefey2013-05-18 05:49 pm
Entry tags:

Free CodeSchool for a weekend

If you're looking to brush up on Javascript, CSS, or HTML skills and you don't already have an account, CodeSchool is having a free weekend May 25-26th.
jportela: (Default)
[personal profile] jportela2010-07-14 07:27 pm
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 :)
cesy: "Cesy" - An old-fashioned quill and ink (Default)
[personal profile] cesy2009-10-09 04:45 pm
Entry tags:

More Javascript help, please

I have a link, and when you click on it, it calls edit_tagcloud(tagname);.
I then have a function defined:
function edit_tagcloud(newtag)
{
if (! newtag) return;
var cur_taglist = document.getElementById('prop_taglist').value;
if (cur_taglist.length > 0) {
cur_taglist = cur_taglist + ", " + newtag;
} else {
cur_taglist = newtag;
}
document.getElementById('prop_taglist').value = cur_taglist;
}

What I'm aiming for is that tagname is added to the list already in prop_taglist, which is the id for the tags input box. However, the code above doesn't work - nothing happens when I click on the link. Can anyone tell me what I'm doing wrong, or give me any tips on how to debug Javascript like this?
cesy: "Cesy" - An old-fashioned quill and ink (Default)
[personal profile] cesy2009-09-21 08:05 am
Entry tags:

Javascript help

I am trying to implement a solution to Bug 581, and I need to do some Javascript that will make a hidden section appear when clicked on. So far I have this:

$out .= "Click here to see all your tags";
$out .= "


(and then the actual content in the span). What should my ShowTags() function actually do in order to change the style to display:inline? I found one example on the web, but it used fancy browser-sniffing, and it appears we have our own browser-sniffing module and I don't know how to adapt it for that.