javascript

The simplest way to allow a web user to update a text file using PHP and Javascript?

Problem: I dont know the simplest way to allow a single web viewer to update data in a text file on a server. (ie. only 1 person will be changing the data.) Objective: To make a prototype web application just one person needs to input in the start and end dates of new assignments and locations of staff and the whole company can visual...

JQuery - Duplicate Field Input Text In Real Time

Hello, I'm trying to figure out how to copy a users text input in one form field to another. Specifically, when someone fills in their email address in the contact form, it will be duplicated in the mailing list form. Both these forms are using ajax so there's no concerns about the input text being lost on submit. This is the code I h...

Don't show if it is empty, how to do with Javascript or jQuery

I am very new to Javascript and jQuery. I managed to make a dialog box with jQuery, it is giving a warning before submitting. The problem is I don't want to show the label and field on the warning page if it is empty. I can't do this with PHP because form is not submitted. I need to do with jQuery or Javascript. <script type="text/jav...

browser.onfocus() aka window.onfocus() for all browser tabs

Hey! Is there any way that, if you have 2 or more open tabs of the same page, when you focus a tab, all other tabs will be instantly notified with "focus()"? I give as example the Facebook Chat. If you receive a new message, all tabs keep blinking "New message from {name}!". And, if you focus a tab, all other tabs are instantly synchro...

captcha image coming back a binary data? How to display this?

I am retrieving a captcha image from the Java based package "SimpleCaptcha" On the front end I just put the following in my page and I get a captcha image: <img src="stickyImg" /> I want to reload this captcha image onclick using javascript. I tried: $("#theclickhandler").click(function(){ $("#stickyImg").load('stickyImg', fu...

Why do designers use sIFR if they can use @font-face ?

Why do designers use sIFR if they can use @font-face ? What is wrong with @font-face ? @font-face { font-family: "Hacen Tehran_eot"; src: url('Hacen Tehran.eot'); } @font-face { font-family: "Hacen Tehran_ttf"; src: url('Hacen Tehran.ttf'); } p { font-family:"Hacen Tehran_eot", "Hacen Tehran_ttf", sans-serif; ...

How does JavaScript deal with function objects? See example.

I have a function like this function saveProfile(data, url, successFn) { $.ajax({ dataType: 'json', data: data, url: url, type: 'post', success: function () { successFn(); } }); } is there any difference to passing the successFn directly like this... function saveP...

Finding everything but anchor tags within a <p> tag with regex

I have several HTML blocks on a page set up like: <p class="something"> <a href="http://example.com/9999"&gt;text 1 2 3</a> <a href="http://example.com/2346saasdf"&gt;text 3 4 5</a> (9999) <a href="http://example.com/sad3ws"&gt;text 5 6 7random</a> </p> I want to get the digit that is in the parentheses, with them. I h...

HTML Layout Problem - Javascript causes Flex layout to jump in Webkit

I want a specific layout for a website. I need the the upper section of the site to take the amount of space it needs (which varies during the page's lifetime as I hide/show various pieces of it). Then I want a lower section to start where the upper section left off and use the rest, showing a scrollbar if necessary. I got just experi...

JavaScript: Call init function vs. returning that function call

Didn't think carefully about this post before submitting. Apologies. ...

JavaScript will alert nodeValue, but when trying to display the text, it's null or causes errors

I have been having tremendous trouble getting this to work. There is no reason (to my knowledge) that this shouldn't work. var xpath = '/course/module[@id=\''+modId+'\']/child::*'; var getData = sxe(xmldoc, xpath); var result = getData.iterateNext(); The function returns the xpath. Just looks cleaner. This works 100%. while (results)...

function remove doesn't work, please help

Hi, If someone here is willing to help me I would really appreciate the function removeInput() of javascript at below not work properly, what i should do? <script language="javascript"> fields = 0; function addInput() { if (fields != 10) { var htmlText = "<input type='text' name='friends[]' value='' size='auto' maxlength='...

smoothly move character on and off screen HTML

An Example of the problem Randomly i have a character on screen. He starts offscreen and smoothly moves onto the screen. However i have the problem with it moving offscreen. Right now i put him in the body using jquery. When it gets to the right side i plan to remove him by checking the width and waiting until he is completely out of sc...

Why would a HTML page have a class of ‘javascript’?**Ignore incomplete question

**Ignore incomplete question///Why would a HTML page have a class of ‘javascript’? ...

How to retrieve custom Dojo widgets after they've been created in a declarative manner

I found that Dojo has the most awesome and unappreciated feature - Declarative widget instantiations/layouts. This is the type of instantiation where you create the widget with raw html, and don't need any javascript (simply by specifying the dojoType attribute). (I discovered this by following this awesome (although horribly css'ed) tut...

Code questions for Jquery

Which code will work fastest? for(i=0; i<100; i++) { jQuery("#myDiv").append("<span>" + i + "</span>"); } // var i, markup = ""; for (i=0; i<100; i++) { markup += "<span>" + i + "</span>"; } // jQuery("#myDiv").append(markup); // var i, markup = ""; for (i=0; i<100; i++) { markup += "<span>" + i + "</span>"; } // jQuery(...

Webkit transitionEnd event grouping

I have a HTML element to which I have attached a webkitTransitionEnd event. function transEnd(event) { alert( "Finished transition!" ); } var node = document.getElementById('node'); node.addEventListener( 'webkitTransitionEnd', transEnd, false ); Then I proceed to change its CSS left and top properties like: node.style.left = ...

Why does this setTimeout code build up and not terminate?

If you click the body of the html once and wait until the ball is offscreen its fine. However if you clicked 2+ times you'll notice the ball moving faster. When you click the body again to make the ball come back it is still faster then it should be. Why? http://jsfiddle.net/44nwt/10/ -edit- in firefox on my page (i havent tried on jsfi...

Send data between XUL components

Hello, I have an extension composed of a browser overlay(ff-overlay.xul) which launches a sidebar(ff-sidebar.xul) through this code (from mozilla extension generator): (in ff-overlay.xul) <menupopup id="viewSidebarMenu"> <menuitem key="key_openSidebar_testinstallPackage" observes="viewSidebar_testinstallPackage" /> </menupopup> <k...

grails development: eclipse vs. intellij idea

hello, i downloaded sts and installed the grails/groovy plugins which is good, but i can not use the javascript functionality like jumping trought classes and functions in the javascript editor. when i click command and on the functions name, than i get a dialog saying "you have to make this a javascript project etc." :( :( intellij is m...