javascript

"touch" a DOM element

Is there a handy way to "touch" a DOM element? I'd like to remove the element and insert it again at the same position. Something like this: element.parentNode.removeChild(element).appendChild(element); except that appendChild inserts the element as the last sibling. ...

Augment a DOM element

Is it possible to augment a DOM element by adding a new property to it as augmenting a normal JavaScript object? For example, can we add a new property of a button or an input, say a value that indicates when was the last time user click on it? ...

How to scroll HTML page to given anchor using jQuery or Javascript?

Id like to make browser to scroll page to given anchor, just by using javascript. I have specified name or id attribute in my html code: <a name="anchorName">..</a> or <h1 id="anchorName2">..</h1> I'd like get same effect as you get by navigating to http://server.com/path#anchorName. The page should be scrolled so that the ancho...

AJAXy action accessible via "normal" request

Greetings, I have an application which contains a calendar as alternative index view for Courses (Project has_many Courses). There I have two arrows for navigating to the next/previous month, it works via AJAX. Now, that's my action for updating the calendar: def update_calendar @project = Project.find params[:id] @date = Date.pars...

JS code generation to avoid de facto open-sourcing my code?

I want to build a small library based on Raphael.JS for work, and none of us particularly like the idea of open sourcing our code. How insane would it be to write all the logic in Python and have it generate hardcoded JS for each "drawing", as a function of the input data? I know this could increase the size of the downloaded JS (espec...

Set Javascript variable every n sec. When it's changed also create a json array of variable?

My variable of numbers updates every one second with mathrandom to some numbers like "14323121" I want to also every seccond save these to an array for say the latest 10 or so. function EveryOneSec() { var numbers = math.Random(); // I want to create an array from this... setTimeOut(EveryOneSec, 1000); }; To bind "numbers" to an a...

Storing the result of a dynamic text field into separate database fields

I am working within the confines of a php based CMS like system, which defines custom form fields that can be used when making a new page. I have two tables in my database, one called people, which has three fields, firstname, middlename and lastname, and a second table called orders, which also has firstname, middlename and lastname fi...

How can I stop a jQuery function on hover?

I have a jQuery function that is running on setInterval(); What I want to do is stop the interval when I hover over the div being displayed, and once I hover off the div, start the interval again (aka continue cycling through the divs). any idea on how to do this in the simplest form possible? Thanks! Amit ...

select all checkbox by one checkbox not working.

following is my code, can any one tell me whats going wrong. <input type="checkbox" name="Chk[]" value="<?php echo($arr['id']); ?>" onClick="Click()" id="CK">// all checkboxex <input onClick="selectall()" type="checkbox" value="yes" name="c1">// one checkbox /*function called*/ function selectall() { if(document.frm.chk.val...

Two Javascripts in one Input

Hello, i try to make two js in one Input, but only the Tooltip works. <input type="password" style="background-color:#ffffff" size="10" name="pw" onfocus="doit()" tooltipText="test"> This is my doit function: <script type="text/javascript"> function doit(){ document.getElementById('username').value="pcid1" + document.getElementById...

Problem in alphanumeric regular expression in javascript

i want to validate user input for alphanumeric characters and for that im using var regex = /^[a-zA-Z_0-9]$/; var asdfsfd = $('#vcr_LinkName').val(); if (regex.test(asdfsfd)) { alert("true"); } else { alert("false"); ...

What script executes after clicking the button (Web app)?

Hi all! I'm automating the manual testing of some Web Application. This app uses a lot number of JavaScript. And I want to know, what scripts executes when I manually clicking some button. Here is the example of button's code: <button type="button" class="x-btn-text " id="ext-gen525" title="Add Options">Add</button> This button adds...

I want to know the use of these options in firefox "Web Developer Toolbar"

I want to know the use of these options in "Web Developer Toolbar" Disable > Disable Javascript > Strict Warnings Disable > Meta Redirects Disable > Meta Referers Disable > Disable minimum Font size CSS > Use border box model Information > Display Table Information Information > Display Table Depth Miscellaneous > Show Comments ...

post value from one iframe to another iframe

hello, i have two iframes in my page and i would like to the value of an input field form one iframe to an input field of the other iframe ...

Is it possible to use requirejs when modules may have to be removed to conserve memory

We develop an application in an embedded environment. It is a high level computing environment with a complete webbrowser on top of a busybox Linux system. The only exception is that the system has a limited amount of system memory. Our application is built in JavaScript and runs inside a Webkit based webbrowser and consists of a lot of...

jquery advice or help converting flash to jQuery

Hi, I was task to convert a something like this flash file into jQuery... any help or advice? it should be html 4. I'm not new to jQuery so if you have links that I can use to help me build this would be appreciated.. thanks, Reigel edit: update/progress okay, as jAndy suggested, I found this for rotating images ...

Stop javascript functions from running

I have a few validations happening in the first step of a form. When the next button is clicked, an age verification is run, if it is true then it runs three functions. function checkAge(form) { return false; } else { validate('theForm','email'); hideFormOne(); showPartTwo(); return false; }; and the function is funct...

Iframe redirect error

Hi guys, I have a facebook iframe application that is having trouble redirecting, I keep getting security certificate errors like these "Content was blocked because it was not signed by a valid security certificate.", here is the redirect code, $params = array( 'canvas'=>1, 'fbconnect'=>0, 'req_perms'=>'user_photos,publish_s...

how to create rar/zipfile and download

Hi frnds can anyone tel me how to Create a Zip File Using PHP? Actually i am having 10 files with boxes,if i select more than one check box that files should get zip/rar and i am able to save that in some path.. Please can anyone help in this solution as i am new to php ...

modifying the POST data sent to a limited PHP form.

I am using a CMS-like system, phpBMS, which defines certain fields and ways to generate a form. Here is the sample form provided. It is possible to include javascript files and incorporate script into the form as well. I would like to know if it is possible, within the confines of the framework I am working with, to send additional dat...