javascript

Getting focus on a Div

Does there exist some trick other than tabindex attribute so that a div can get focus ? ...

JAVASCRIPT: subtracting Time and getting its number of minutes

For Example: StartTime = 00:10; EndTIme = 01:20; These variables are string Question: How can i Subtract them and returning the span time in minutes? Hope you can help ...

Javascript validation is bad?

Hi, It has been long time since we have been validating our forms using javascript. I am sure this must be the case with most other developers. Question: What if the user (or probably a bad guy) disables javascript? You are lost !! Is javascript validation worth of it? Should we ever use it now? Are there any solutions to this? Cor...

Ext Js Javascript execution

I have a typical Ext Js style window with a left navigation, header and central region to display stuff. The left navigation has a bunch of menu items that when clicked on load something via the Panel.Load() method from a specified url into the central panel. My problem is that in IE if i click many menu items too fast i get various...

asp cookie vs javascript cookie

what is the difference between asp cookie and javascript cookie. by asp cookie i mean cookie created using response.cookie & which one is better ? ...

how to access master page control in child page .aspx page(in javscript)

hi in my master page.cs i am assiging an value to hiddenfield hfSession="abc"; in my content page(default.aspx) i need to access this value in my javscript <script type="text/javascript" language="javascript"> function(sender, e) { var Sessioninfo= $get('<%= ((Hiddenfield)this.Master.FindControl("ct100_hfSession"...

Uncaught ReferenceError: Invalid left-hand side in assignment

<script> function urlencode(str) { return escape(str).replace('+', '%2B').replace('%20', '+').replace('*', '%2A').replace('/', '%2F').replace('@', '%40'); } $('input#q').keyup(function(e) { if(e.keyCode == 13) { if($('input#q').val().length > 2) { $('input#q').val() = urlencode($('input#q').val()); document.search_form.su...

Defining Arrays in Prototype Classes?

Hi there, I was trying to create a prototype object with four attributes: 'name', 'basis' and 'rows', which are values taken from a form and 'head' which should be an array of string values. Classdef: var TableTemplate = Class.create(); TableTemplate.prototype = { initialize: function(name, basis, head, rows) { thi...

JS: How to make document.getElementById cross-browser?

Hi, document.getElementById doesn't seem to work across all browsers (I mean some old ones) and I am sure there are developers who are not aware of this. What solutions would you suggest to make it cross-browser? Thanks ...

Is there a way to verify the integrity of javascript files at the client?

I'm working on what aims to be a secure method of user registration and authentication using php and javascript but not ssl/tls. I realise this may well be considered an impossible task that's been tried 1000 times before but I'm going to give it a go anyway. Every example I see online that claims to do it seems to have some huge fatal ...

Jquery validation don't hide the error message when value is valid

I wrote a decimal validation method to validate the text in a texbox: $.validator.addMethod("decimalCheck", function(value) { var v = new RegExp("^\d*[0-9](\.\d*[0-9])?$", "g"); return v.test(value); }, "Error here"); The first time, I inputed "12,34" string to textbox and error message display. The sec...

Using jquery , how to check whether a table cell is empty or not?

Using jquery , how to check whether a table cell is empty or not? Please help me. ...

JavaScript to Replace One QuickTime movie with Another

hi I am very new to javascript so bear with me: I am trying to replace one quicktime movie with another one, so far i have used this code from apple and it works great you can see my efforts here: http://www.centurysunstudios.co.uk/test/ please look at the source code (i tried to past the code here but would not let me for some reaso...

read number of charaters in HTML text using javascript

suppose i am getting HTML text in my JavaScript function as var TEMP= result.data; where result.data='<p>BODY&nbsp;Article By Archie(Used By Story Tool)</p>'; i have done this: var e = document.createElement("span"); e.innerHTML = TEMP; var text = e.innerText; var characterCount = tex...

Using JavaScript to normalize Url Rewriting strings entered by users

String.prototype.NormaliseUrl = function () { var url = this; var preserveNormalForm = /[,_`;\':-]+/gi url = url.replace(preserveNormalForm, ' '); // strip accents url = stripVowelAccent(url); //remove all special chars url = url.replace(/[^a-z|^0-9|^-|\s]/gi, '').trim(); //replace spaces with a - u...

In JavaScript is != same as !==

Possible Duplicates: Javascript === vs == : Does it matter which equal operator I use? Javascript operator !== Look at this commit Is != same as !== in JavaScript? [1]: ...

How to add an element befroe the first element?

Hello. I am working on a comments system. I am using PHP + jQuery, I need to add the last comment to the top, i mean before all the DIV elements. E.G. <div id="comment"> <div class="comment-3"></div> <div class="comment-2"></div> <div class="comment-1"></div> </div> So now I want to add the new <div class="comment-4"></div> with jQue...

how to assign an value from javascript variable to hidden field

hi, <script type="text/javascript" language="javascript"> function(sender, e) { var **Sessioninfo**= $get('<%= ((Hiddenfield)this.Master.FindControl("ct100_hfSession")).ClientID %>'); } </script> here from my master page hiiden field i am getting the value in Sessioninfo now in child page i have anot...

file upload problem with form check js

hi, I am using the following mootools1.2 form check js. http://mootools.floor.ch/en/demos/formcheck/ For form check is working fine, its working fine with ajax form post. My problem is that when i post the form with AJAX with file upload. Then its not returning me the $_FILES array to PHP side. If i post the form normally (i.e. with...

Scriptaculous Effect.Grow() start from set size, not 0

I have a div that appears if errors were encountered during a processing step. I have a 'More Info' link which, when clicked, I would like to expand and show specific errors encountered. I thought I could use scriptaculous and the Effect.Grow() animation but this seems to always start from 0px x 0px and scale up. Is it possible to star...