javascript

Please suggest a good solution

In my project, I want to implement code where I need to keep two list box(asp control), and I want to implement add remove like functionality between these two list box that is removing one item from list box should be added to another and removing from another should be added to first. How can I use JavaScript to achieve this effect? A...

Compile HTML code heavily?

Possible Duplicates: How to encrypt HTML, CSS and JavaScript to prevent theft What are some good ways to prevent people from copying my source code? Is there any good way to compile HTML? I'm working on a page that contains HTML code and some CSS and JavaScript. Is there anyway that I can compile it so that other people cant...

MySQL -> PHP -> JS/jQuery

I'm a bit confused about displaying data from a MySQL database. I would like to make a single $.getScript(''); request to grab point values if possible, but my trouble is getting it to work with multiple members. I need to grab the point values for each user by their ID number. (this is for a forum software- ZetaBoards.. basically a poin...

Learning YUI from scratch

Hi, I am new to YUI and I want to learn it from scratch. Can you suggest some books or tutorials? Where should I start? It seems YUI 3 is different from its predecessors. Please help me. ...

Duck Typing in Javascript

Could someone give me an example of Duck Typing inheritance in Javascript? I'm exploring OO javascript and I've heard about duck typing but can't see any examples of it being used in javascript. ...

How to automatically increment text value on sequential inputs

I have this unordered list which contains some inputs, what I want to do is to type a value on the first input, like "1", then all the other inputs, in order, gets 2, 3, 4, 5 ...

JSON Object Passing Help

Hi, A while back i was given the answer of using json to pass things from my application to java script. What i don't understand is how i actually pass the object to javascript i see that you have to use a .json file. And then what? I am able to convert my java objects to JSON objects but its passing that i can't get my head around. I am...

How to convert selectors and event capturing from jQuery to plain JS?

Can someone please help with converting this code to plain JS: $(document).ready(function() { $("textarea").bind("keydown", function(event) { var textarea = $(this).get(0); //further will need only textarea and event vars } }); I don't care about cross browser compatibility as long as it works in curr...

Update select multiple

I'm trying to write a function to update the "multiple" select (the second one below) such that when I select Method1 (from the first select), only the options 1A, 1B and 1C appears in the second select, and likewise for 2A, 2B... only when I select Method2. Is there a way to do this. Please help. Many thanks in advance. <select name="...

jQuery Get the second or x div with certain class

This should be simple, but I can't figure it out For example, lets assume the class .contentdiv is what were searching for. I want to obtain (or select) the second or (x amount) .contentdiv in a document then get the html of that div. x being the div i want to select so pretend x is 1,2 or 3 or any number jQuery('#slider').filter('.c...

Somehow, my class doesn't manage to define some variables...

So, I'm using whatever Object-Oriented options has to try and make a neat static image class so all I have to do is add said class to Canvas, and it will draw itself out! To test if everything worked, I added up some alerts. Now my Function starts spewing 'undefined' at the third alert. function StaticImage(imgsource, cancontext, ex, wy...

What's jQuery's css syntax for addition and subtraction on numerical values?

I'm certain I've seen this before. This is how i remember it $cnta.css({ top:'+=50' }); Needless to say, it doesn't work :-) I know i can parse the css value, manipulate the result and put it back into css, but that takes twice the code. Thanks for answers! ...

Can Javascript get a function as text?

Can Javascript get a function as text? I'm thinking like the inverse of eval(). function derp() { a(); b(); c(); } alert(derp.asString()); The result would be something like "a(); b(); c();" Does it exist? ...

Canvas drawImage using data URL

I'll start with the script: function saveInstance() { _savedInstance = document.getElementById('canvasID').toDataURL(); } function restoreInstance() { ctx.drawImage(_savedInstance,0,0); } The purpose is to save an instance of the canvas and re-apply it later [Similar to how ctx.save() saves the style and transformations...

jquery: Paste a set of elements over another set of elements / merging elements

I have 2 sets of elements: <div class='container container1'> <div class='colors'> <div class='blue'></div> <div class='red'></div> </div> <div class='drinks'> <div class='soda'>coke</div> <div class='juice'></div> </div> </div> <div class='container container2'> <div class='cars'...

Problem sorting an array of objects by date & time in Javascript - null values allowed

I'm working with an array of objects in Javascript and need to sort them by date and time. Here's the setup: place title date (optional) time (optional) Conceptually, the application allows users to create a list of places they're planning to go. The array of events is manually ordered at first, and users can optionally add date ...

Parsing the Freebase Topic HTTP API - JSON & Javascript

Hi, I am trying to parse a JSON output: http://www.freebase.com/experimental/topic/standard?id=/en/colonel_sanders I'd like to put the basic data into an array using Javascript. In the "properties" object I'd like to grab any "text" element one level under "properties" as a label and grab the "text" under the "values" object to match t...

Prototype Javascript Error (only in IE) 'Object doesn't support this property or method'

One of our devs through together a banner rotater, and while it works fine in NOT IE, IE is throwing an error at line 30 (marked below with "* ERROR ON NEXT LINE"). Can I not sort $$('.banner')? The error is: 'Object doesn't support this property or method' Using Prototype 1.6.0.3 function changeBanners() { // banners are now sorte...

javascript/jssh issue firefox 4.0b1

I built jssh for FF 4.0b1 and packaged as an xpi and installed it to my browser, when running javascript that checks tags for a certain phrase in the onclick or onfocus events I am getting an NS_ERROR that says component not available has anyone seen this happen as of yet? It only happens when the tag is either not the first one on the...

Building a Form that allows the Browser to Prepopulate with the Username/Email & Password

Hello, Users are complaining about my site, saying that they Sign In form is "not allowing the Firefox and Chrome browsers to "remember password". You should allow people to remember the password in their browser--it will come in handy in the future on future visits." Any ideas why this would be the case? ...