javascript

Resizable Textarea Like on SO using Vanilla Javascript

I'm basically looking to duplicate the functionality of the draggable resize function of the textareas here on SO. I know SO uses the jQuery plugin TextAreaResizer to accomplish this, but I want to use straight vanilla javascript so that I can learn how it actually works. ...

Javascript error - Blocking IE performance.

I am trying to run a script, which is intense(that is lot of loops etc.). When I am trying to call this method in loop, I am getting an error: "The JavaScript operation is blocking the normal operation of IE. Do you want to stop running the script?" Yes No. Is there something I am missing? I have seen worse scripts running just fine...

javascript - how to open a new popup with query parameters

I would like to use Javascript to popup a new window with query paramters. For example (www.google.com/ref=tag?value=5). Even when I passed in "www.google.com/ref=tag?value=5" as the URL to window.open, the query parameters (ref=tag?value=5) are ignore. What do I need to do? ...

javascript - page reload

Can somebody please help me with java-script page reload that works irrespective of browser ? solution is expected ASAP .. Thanks ... Resh ...

calling alert box from code behind java in jsf

I have a requirement to update the properties file based upon the input provided by the user in the jsf page. After updating the file, user session should be cleared and alert box should say 'setting has been updated' and the page should navigate to the login page. I don't know how to call a alert box from java code. I found this to ...

HTML5 support information

I have been facing difficult time finding which browsers support which HTML 5 API and which not. Is there a website where i can get information like which browsers supports(have implemented) which HTML5 API(file, canvas, geolocation ......) and which are not yet supported ........ at one place. Yes, i would like to get information for...

How to know that a string starts/ends with a specific string in jQuery ?

I want to know if a string starts with the specified character/string or ends with it in jQuery. For Example: var str = 'Hello World'; if( str starts with 'Hello' ) { alert('true'); } else { alert('false'); } if( str ends with 'World' ) { alert('true'); } else { alert('false'); } If there is not any function then any al...

Simulate change option in a select with JavaScript?

In this site, for example, there are 3 SELECT elements (Step 1, Step 2 and Step 3). I'm able to change the value of the first one with selectElement.value = selectElement.options[i].value;, but when I change it the Step 2 doesn't update it's options as it would if I would select it with the mouse. Is there any way to force it to update? ...

How do I bind to the scroll wheel when over a div?

I'm creating an image editor in the browser and I've got the code for all of my controls done. Now I'd like to map hot keys and mouse buttons. the keyboard is easy, but the mouse is not. I need to detect when the mouse is over the canvas div and when the mouse wheel is moved above it. The mouse over part is not hard, its binding to the ...

Form Validation using Jquery

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title>Validation POC</title> <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script> <script src="Scripts/jquery.validate.js" type=...

Key value pairs using JSON

Is there a way to handle data structures using JSON object in a way of Key/ Value pairs? If so can some one elaborate how to access associated value object from the key Assume that I have something like this KEY1 | VALUE OBJECT1 - (NAME: "XXXXXX", VALUE:100.0) KEY2 | VALUE OBJECT2 - (NAME: "YYYYYYY", VALUE:200.0) KEY3 | ...

How to delete every first div when it reaches certain limit ?

Can anyone guide me to delete the first div, when there are 5 div's I'm cloning a text box, users can add multiple textbox's but when it reaches to 5, i should automatically delete the first textbox and add another at the end of the node Thanks ...

Complex js obfuscator

hello, I need a complex js obfuscator so that the js file won't be easy to reverse with a public tool like http://jsbeautifier.org/ ...

Javascript - GetColoumnValue - IE6 problem

Hi all. I have a js function named "GetListColumnValue". This function causes some problems with IE6. Is there any way to avoid the problem? (I thnk the problem is occured because of the concat) Here is the code sample. The last line is my solution which I am not sure that it works well. Any suggestions? Thanks. function GetListColumnVa...

How can I write an async method in JavaScript when posting or looping?

I have made a loop in my JavaScript code and in that loop I use an XMLHttpRequest with a callback method but I'm having a problem with it. When my loop ends the callback executes. This is not good, I need the callback to execute after calling a function, not after looping. How can I do this? Somebody on a blog wrote that I can use an ...

2 dimensional array in javascript

Hi, i would need to store in a javascript variable the following table: Nodeid parentid theme Document 4787814 4787484 Theme1 Document 1 4787824 4787484 Theme2 NULL 4787834 4787824 Theme2.1 Document 1 of theme 2.1 4787834 4787824 Theme2.1 Document 2 of theme 2.1 4787834 4787824 Theme2.1 Document...

Identify selected tab URL of firefox browser in javascript

Hi I am working on one web application. I am interested in to fetch selected tab URL. I am using Firefox browser. I achieved this by executing below javascript statements : /* Get the URL of page which is currently loaded in active tab */ var currentPageURl = window.top.getBrowser().selectedBrowser.contentWindow.location.href; alert...

Javascript in Opera strange math operations

i have js cript var lf = -10; if(lf < 0 ) $("element").setStyle({left:(parseInt(lf)+10)+'px'}); this lot very strange (parseInt(lf)+10) = - 20; in opera Version 10.62 Build 6438 Platform Linux System x86_64, 2.6.31-22-generic in all another browser (parseInt(lf)+10) = 0; How it can be ? ...

javascript content slider to stop on mouse over start on mouse out

hi, i have a problem with javascript. code below belongs to featured content slider and it pauses when mouse is over a pagination link. what i want to do is restarting the slide.. //** Featured Content Slider script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com. //** May 2nd, 08'- Script rewritten and updated to 2.0...

regex that can distinguish PHP tags contained in HTML tags

I need a javascript regex that can distinguish between PHP tags in HTML tags and PHP tags outside of HTML tags. e.g. <input type="text" <? print '1'; ?> value="<? print '2'; ?>"> <? print '3';?> So I need a regex to pull out: <? print '1'; ?> and <? print '2'; ?> And another regex to pull out: <? print '3';?> At the moment I h...