1. Javascript vs. css

    Date: 03/29/11     Keywords: css, java

    Is there any way to determine what the body text(foreground) color is in javascript, if you are using css to set the text color?

    Look at the select_die function

    Source: http://javascript.livejournal.com/173882.html

  2. Is this acceptable code to redirect mobile users?

    Date: 11/15/10     Keywords: html

    After looking through many pages showing fairly large chunks of JS code (of which I am not fluent) I found this very very short code block which appears to work after a quick test from a Desktop and Mobile device. Is this good enough to use for a non-enterprise site?

    Thanks for any help! :)

    Source: http://javascript.livejournal.com/173384.html

  3. Autostereogram Builder

    Date: 11/09/10     Keywords: no keywords


    Cross-posted to youmaylikethis

    Source: http://javascript.livejournal.com/172952.html

  4. Need help with javascript

    Date: 10/21/10     Keywords: java

    I have a form that has some fields that are being dynamically generated through javascript. This form goes through a validation process and I want to make sure that the fields that are generated dynamically are actually being filled in. The problecm is, it doesn't appear to be able to do that.

    Source: http://javascript.livejournal.com/172657.html

  5. Is there a way to enter password in protected video on Vimeo

    Date: 09/25/10     Keywords: no keywords

    I want to protect my videos on Vimeo using password, but allow users of my site to watch embedded videos without entering password. Is there a way to send keypress events to enter password in onLoad page event? 

    Source: http://javascript.livejournal.com/172542.html

  6. hoverDelay jQuery Plug-in

    Date: 09/24/10     Keywords: no keywords

    Like jQuery's built-in .hover(), but with delay:

    Source: http://javascript.livejournal.com/172260.html

  7. Help with variable scope?

    Date: 09/07/10     Keywords: html

    I have a variable that I want to retain its value between function calls. The page is here: http://zyada-stuff.com/SpreadingRoots/temp.html

    The function is an event listener, and the variable is map_marker0. If I could get the variable to retain its value between calls, line #45 would erase the marker so that it could be reset to a new spot. Right now, the page just creates a new marker.

    Source: http://javascript.livejournal.com/171939.html

  8. JavaScript. 2 issues

    Date: 08/24/10     Keywords: html, java

    I'm a newbie in JavaScript (and jQuery, too).
    I've got some little troubles with it.

    First. I'd love to know how to obtain an ID of clicked element inside click event handler.
    According to the book "Learning jQuery" by Jonathan Chaffer and Karl Swedberg, I gotta use "this.id" construction.
    Perhaps this book is little outdated because it doesn't work under jQuery 1.4.2.
    Calling "alert(this.id);" in the event handler is resulting in "undefined" message.

    Second. I'm trying to figure out how to attach a click event handler to the element created dynamically by script.
    The following line of code is resulting in new unclickable picture on my page:
    myDiv.innerHTML = myDiv.innerHTML + '""';
    This problem is not being solved by using the code like this: $('.Pics').Click('ClickIMG').

    I think these issues are quite common and can be easily solved.
    So you probably can help me.
    Thank you.

    Source: http://javascript.livejournal.com/171768.html

  9. Using Javascript to search a share point list

    Date: 07/16/10     Keywords: asp, java, web

    I found this code a while ago that creates a drop down search box that will search a sharepoint list. I am extremely new to this so I am clueless in how I can modify this code to suit my needs. The code redirects to the same page with querystring data added to the URL. I was able to modify the drop down list and I changed the Column names to match the columns in my list. I changed to column names because it wasnt returning any records and I believe it is because it is referencing the columns that dont match my list. Once I did that it didnt work, It wouldnt return any records. I have a feeling it is because of this piece of code:

    Search Field:
    Search text:

    X-posted to webdesign & javascript

    Source: http://javascript.livejournal.com/171299.html

  10. Nibbler: Multi-Base Encoder Generator

    Date: 04/06/10     Keywords: java

    Recently, I was as surprised as you will no doubt be, to discover that there didn’t seem to be a Base32 encoder for JavaScript! There are lots of Base64 encoders out there (and just as many for Hexadecimal), but Base32 seems to be a pretty small niche.

    So I decided to write my own, and about half-way through, it evolved from a Base32 encoder to a multi-base encoder:


    Source: http://javascript.livejournal.com/170999.html

  11. Knowing just enough to be dangerous

    Date: 03/27/10     Keywords: php, browser, html, google

    I have a php script that is generating a page with Google maps on it. I've extracted the html and placed it here.

    The code I'm trying to figure out is in the initialize function. When the user right clicks on the map, it places a marker there. I've got that working.

    What I want to do next is if the user right clicks on another spot, the first marker is removed and a new marker is put into place. What I've got right now doesn't look like it realizes that a marker has already been created.

    Here's the code I'm working on:

    function initialize() {
    if (GBrowserIsCompatible()) {

    var map0 = new GMap2(document.getElementById("map_canvas_0"));
    map0.setCenter(new GLatLng(31.25044240, -99.25060610), 6);
    GEvent.addListener(map0,"singlerightclick", function(point, src, overlay){
    var cur_ll = map0.fromContainerPixelToLatLng(point);
    if (typeof map_marker0 != "undefined" )
    alert("there's already one marker out there!");
    var map_marker0 = map0.addOverlay(new GMarker(cur_ll, {draggable: true}));
    } );

    Also, the listener function for the event is inline because that's how their example is - is it possible to put this function outside of the addListener call?

    Source: http://javascript.livejournal.com/170691.html

  12. flowchart

    Date: 03/10/10     Keywords: java

    Hi there!
    I need to write some kind of advanced flowchart editor in javascript.  Frankly, I am weak in javascript, so I'm searching for help :) 

    I thought of using SVG for graphics and JQuery.svg as support in coding... But still have some troubles.

    Maybee you have some examples of realizing flowchart editor (or some kind of graph editor) in javascript? It would really help!
    Any kind of algorithms description is welcome too! I mean algorithms of flowchart//graph viewing, not working with data.

    sorry for bad english :)

    Source: http://javascript.livejournal.com/170332.html

  13. Drag and Drop in Mootools

    Date: 03/02/10     Keywords: java, web

    I'm writing my first class using Mootools, building off a class called Drag.Ghost [link] (which itself inherts from Drag.Move; Drag.Ghost -> Drag.Move -> Drag)

    Since I want this to be reusable and multi-purpose, I want to define custom behaviors within the class itself rather than within each page which is the usual, idiomatic way. That is, I want to define the drag, drop, move, etc handlers within the class rather than pass them as parameters to an instance of the class

    The problem is, I can't manage to set these handlers. They never fire at all (again, the class itself and the idiomatic way works fine)

    My version of the class:

    Drag fires, but drop, enter, and leave do not (adding a console.log call to drag produces a message in Firebug. The others do not)

    Drag is an event of the base Drag class while drop, enter, and leave are events on Drag.Move, so I'm thinking that might have something to do with it.

    I have plenty of experience with OOP and a fair bit with JS specifically, but I'm unclear how things work in Mootools yet. I didn't see any references to, say, needing to explicitly call the superclass, but there's apparently something wrong with this subclass preventing it from passing on events belonging to its direct parent. Or maybe not. I'm stumped.

    And here's how I'm calling it in the document HEAD section (which I'm sure is unneeded, but sometimes I miss the simplest things...)

    xpost: javascript webdesign

    Source: http://javascript.livejournal.com/170196.html

  14. jquery, ajax, and waiting until data is fully loaded

    Date: 01/27/10     Keywords: php, html

    We have this little image gallery thing built with jquery. It fetches a page that selects some random images and writes some html, then updates the html in the image gallery container. It's supposed to work like this:

    - button clicked
    - fetch page
    - data received
    - old stuff fades out
    - new stuff fades in

    The images loaded are really big (they're coming from a photographer and we have no control over the file size), so what's happening is the "new stuff fades in," event is occurring while the images are still loading, and it looks kind of dumb. This is a simplified version that just loads one random image: