javascript

Cloning JavaScript Objects. Again :(

I know it is really annoying to read this topic again. Before you start diggin into the code, one solution could be that I don't get prototypes and objects in JavaScript. But at this point i think, i do. The problem is: How to clone an JavaScript Class (created with prototypes), so that the “cloned” Class remains untouched when extendin...

How can I add a key/value pair to a JavaScript object literal?

Here is my object literal: var obj = {key1: value1, key2: value2}; How can I add {key3: value3} to the object? ...

Jquery: Add class unless there is a child of certain class

I want to do an addclass, but only if it doesn't have a child of a certain class. $selector.addClass('addthisclass'); So I want: <div class="addthisclass"><span></span></div> And nothing on here. <div><span class="badclass"></span></div> Anyone know how to do this? ...

PHP Secure Login - Client-side options?

Ok now I am confused. I have been getting advice from SO users on libraries to use with codeigniter for authentication. I have explored dx_auth and simpleloginsecure (I think I will use the latter due to its supposed secure hashing and small footprint). BUT, what about hashing the password on the client side? I haven't seen any mentio...

jQuery validation custom method didn't work

Hello all I have added a method on jQuery validator like this $.validator.addMethod('myEqual', function (value, element) { return value == element.value; // this one here didn't work }, 'Please enter a greater year!'); $.metadata.setType("attr", "validate"); $("#educationForm").validate({ showError...

animate textarea content

I have a paragragh of user entered text in a textarea. line1 line2 line3 intially all text would be black when a button is pressed each line's color changes to red gradually (2 sec each line) can this be done with only jquery? ...

jquery-how to detect child id?

<div id="first"> <div id="here">...</div> </div> <div id="second"> <div id="here">...</div> </div> jquery: $("#second #here").click(function(){}); how to write jquery to detect when I click the second ? ...

switch statement and loops using jquery/javascript

Is there a way I can generate switch statements in jquery/javascript by using some sort of loop to do the work for me? For example, if I had a statement like: switch ($("#play option:selected").text()) { case '1': $("#play_1").slideDown().find("input").addClass("someClass"); break; case '2': $("#play_1"...

(Rails) How do you replace the text of a "link_to_remote" without breaking the link?

Hi All, Is there a quality way to update the text inside a "link_to_remote" and leave the link functional? Basically I have two links: <%= link_to_remote "(#{building.charts.size} Charts)",{:url => {:action => "update_chart_matrix", :chartable_type => "building",:chartable_id => building.id, :title => building.name}, :update => 'ch...

What is Jquery's alternative to Mootools MochaUI?

MochaUI is very intuitive and the modal iframes almost perfectly replicate Windows. Unfortunately, I have scripts written in Jquery that I use, and I hear there are conflicts when putting both Mootools and Jquery on one html file (is this true?). How can I get the MochaUI features in Jquery? At the very least, is there a similar modal ...

Page Stats always show the name of an IFRAME, and not the real doc name.

I have a website with multiple pages. All of the pages have an embedded IFRAME in them (always the same iframe src). My problem is that the iframe contains some statistical tracking code, (like statcounter), and statcounter only shows the name of the iframe as the page being visited. Is it possible somehow to include a few lines of jav...

Find unused Javascript functions?

I have around 100 .js files in my application. I need to find the unused functions from these files. Which editor or tool can help me? ...

Inherited CSS Values via Javascript

On my page I am changing some css styles via javascript. When I try and pull a value that has been inherited - it comes up blank. Consider the following: .Sliding { display: none; overflow: hidden; } .Sliding #FilterBox { height: 185px; background-color: Fuchsia; } And the html:...

Are AJAX sites crawlable by search engines?

I had always assumed that AJAX-driven content was invisible to search engines. (i.e. content inserted into the DOM via XMLHTTPRequest) For example, in this site, the main content is loaded via AJAX request by the browser: http://www.trustedsource.org/query/terra.cl ...if you view this page with Javascript disabled, the main content a...

Inserting date in sqlite db using adobe air and javascript

I am trying to insert a date value in sqlite db using air and javascript. The value gets inserted but when I try and view it, it says null. Later I found that SQLite stores date using julian format. How to convert a javascript date object to julian format? ...

jQuery dynamic event binding

I think this is a pretty basic question, but I'm struggling with this problem. On my form I have an option to dynamically add a new row to the table, which is simple enough to do with jQuery. On one of the elements, I need to bind an event, also relatively straightforward. The part I'm having problems with is the event that needs to be ...

Scroll Bar in a Frame

Hi, I have designed a frame in a window. The frame size is fixed. I dont have/dont want a scroll bar for the frame. If the Text overflows in the frame,I want to have a windows scrolll bar instead of a frame scroll bar for controlling the overflowing part. thnks.. ...

How can you convert blank spaces to &nbsp; in javascript

Without using regular expressions, how can you convert blank spaces to &nbsp; in javascript? ...

How to get div content which changed by javascript?

I have a div on page, which content will change by javascript, I want get its value from c# code. but, its always returns empty or initial value, not changed value. If I changed from div to hidden, it works well. I don't know why? here is the code: <head runat="server"> <title>Untitled Page</title> <script type="text/javascri...

Dojo widget defaults

Hi All, i'm currently writing a large scale application heavily based on the dojo toolkit. The whole app is working and standing, but one issue i can not find my way out with, is the creation of custom widgets. It would be useful because it would clean up my source code and also i can reuse this 'widgets' in later projects. For example...