javascript

Problem about nested escape character

I want to pass jquery command into eval() function but I have found that some situation is not work. For example, I have $('input[name="lastName"]').val("xxx"); Then I pass into eval function eval("$('input[name="lastName"]').val('xxx');"); eval('$('input[name="lastName"]').val('xxx');'); Because there are too many " or ' block i...

How to replace a string at a particular position

Is there a way to replace a portion of a String at a given position in javascript.For instance I want to replace 00 in the hours column with 12 in the below string.The substring comes at 13 to 15. Mar 16, 2010 00:00 AM ...

JavaScript passing varibles between functions and processing them....

Hello, I'm working on a JavaScript based page that returns the cost of delivery, depending on what the user selects(Region, service(pre 12, etc) and weight). I have muddled my way through as I just dont know JS. My questions are: Can I pass the varible between functions - as detailed in the script below? Once the above has been achie...

How to declare a javascript class with short function names and assign later to a long class name?

Let me explain, this is about displaying class source code in IDEs. I have always only one class per file. A class is declared like this in the file mod1.js: MYGLOB.MOD1.ClassXy = function () { //constructor, do somothing } MYGLOB.MOD1.ClassXy.prototype.memberfunc1 = function () { //member function 1, do somothing } (There are ma...

Is there a min. version of the jquery datepicker javascript file

I want to know if there is a min. version of the jquery datepicker javascript file ...

Circular reference in HTC element behaviors

Hello there, We develop our pages based on HTC element behaviors (let's call them 'htc' for short). One of the components is a dataGrid.htc which has many dataGridItem.htc inside of it. These items are created on demand. So, in dataGrid.htc I import the item: <html xmlns:dataGrid> <head> <?import namespace="dataGrid" implementation="d...

document.write('<scr' + 'ipt src= vs <script src=

Hi all, Apart from allowing you insert js variables into a script tag when written like document.write('<scr' + 'ipt src= what are the pros/cons of this vs a normal <script src=> tag? I'm mainly asking with regard to speed but interested in the whole story. Thanks Denis ...

How To Enable Keyboard Navigation for Large Application

I Have a Large Asp.net (somepages are Ajaxable but not all) which I want to Activate Keyboard Navigation for it. Some Shortcut key chosen to do or call some methods & Functions or visible and hide Page Elements. these shortcuts are more than 50 keys in addition users must be able to change any shortcut (in this time is not necessary bu...

change status message on page

I'm using this code to change the status bar of IE. <a href="http://www.google.com" onmouseover="window.status='Google';return true;">Google</a> But the problem is when i'm using a menu (links inside a div) it doesn't change anymore the status bar. Is there any way to fix it? ...

bind method of javascript

what is the use of bind() in javascript?? ...

Firefox Or JavaScript, count the DOM

I'm sure this is simple but I have no idea how to do it. How do i count the amount of DOM elements in my HTML page? I wanted to do this in a userscript or bookmarklet but i have no idea how to start! ...

javascript: getting two sibling windows communicate

i have 2 windows: window A and window B. -window A and window B have same domain -window A and window B doesn't have any parent window. first question: -is it possible for window A to get a reference of window B? second question: -what is the most elegant way to make window A notify something to window B? (including new HTML5 specs) ...

xmlhttprequest: "password" from txt-file

Hi, I'm new to javascript/ajax and a bit stuck right now. The assignment is to use only javascript/ajax. I'm supposed to make a login-form, and when typing in the right password it will display a "secret message". Currently this message is an alert-box. This is in the script for validating the form input: var riktigPassord = 'password...

Redirecting Request (nsiHttpChannel?) in Firefox Extensions

I've been trying at this for a long time now, and no good results. var myObserver = { observe: function(subject, topic, data) { if (topic == "http-on-examine-response") { // implement later } else if(topic == "http-on-modify-request") { // implement later } }, QueryInterface : function (id) { if (id.equ...

Nested ULs wrapping

Hey all! I got an HTML string that I need to parse (to be used in Flash), by wrapping nested UL tags by a span with incremented left-margin value based on nesting level. Before: <ul> <li>Item one</li> <li>Item two: <ul> <li>One</li> <li>Two <ul> <li>One</li> ...

Include an xslt stylesheet in a html page.

I have some JavaScript that needs to apply an xslt to the result of an ajax request. The xslt is defined in a separate file "transform.xslt" - whats the best way of including the xslt in my page? Is it possible to use some sort of <link... element, or will I need to make a separate http request myself for the xslt? ...

AJAX/Javascript checkbox validation

Hi guys, this is my first post on stackoverflow, I hope you can help me out! I need to have javascript/ajax validation for a checkbox on a form I am making, the checkbox is deselected by default but when it is ticked, a javascript box should pop up displaying this text, "You have selected the newsletter checkbox, are you sure you would...

Tab key in contentEditable div

Hi, i'm building a simple text editor by setting contentEditable=true on a div (anyway i think that textarea behaves in the same way) and i have some problems with the tab key. What i want is that when the user presses the tab key, the focus remain on the div and a tab character is added to the text. I've solved the first part of the...

Problem with Flash and JavaScript Communication

I have an AS2 Flash SWF that is calling another AS2 Flash File using loadMovieNum("flash.swf",2) and a JavaScript file that calls a function on page using a timer. This is what I get in Firefox with Flash 10 (IE8 gives no error message): uncaught exception: Error calling method on NPObject! [plugin exception: Error in Actionscrip...

Client side XForms processing tools

What would be the best client side javascript based XForms processor? I'm trying to migrate plugin (activeX) based Xforms processing solution to a javascript based client side processor. But the migrating XForm does not work properly in any of the client side solutions I found. They give various unfriendly errors and its very hard to f...