javascript

display time in a web page

Hello, I have page where where I list all comments for a post. Next to each comment I have a time value in full format including the date/time (2010-01-02 11:11:20). I know that I can format it in PHP before displaying it, so it shows; posted 40 secs ago posted 5 days ago but that would not be efficient as I am going to cache the...

jquery: IE7 won't prepand a label to the corresponding inputs div-container

Hi! I want to make sure that the structur of my form is like that: <form> <div> <label> <input> </div> <form> I use jquery to catch the label from whereever it is and move it between <div> and <input>. This works fine in Firefox but IE has problems with that. How can I get it running with IE? Here's the line that ...

dojo.data.ItemFileReadStore: Invalid item argument with Dijit combobox

Hello, I have a jsp page with a dijit.form.ComboBox which is populated by a dojo.data.ItemFileReadStore connecting to a back end java server. It works almost as expected, the combobox shows the results correectly. Problem is that I receive a 'dojo.data.ItemFileReadStore: Invalid item argument.' when scrolling in a results list with th...

JQuery beginner Question with data array

Hello i've an data array like this: var data = [ { nachname:"Mustermann", vorname:"Stefan", email:"[email protected]", strasse:"Musterstrasse", hausnummer:"1", plz:"12345", vorwahl:"0361", telefon:"12345"}, { nachname:"Mustermann", vorname:"Robert", email:"[email protected]", strasse:"Musterstrasse", hausnummer:"1", plz:"12345", vorwahl:"0361", tel...

How to delete an HTML element inside a div with attribute contentEditable?

Hi have this html: <div id="editable" contentEditable="true" > <span contentEditable="false" >Text to delete</span> </div> need that the span (and all text inside) is removed with a single backspace, is it possible? ...

Google Map Coords escaping - Resolved

This is the problem: 45°38'14.07" How can escape it (Struts action read an XLS that made a string. This string is the param of array in js). Or without escaping.. how can I use it? ...

How to operate the elements of an array

I have to operate a 4 elements array, calculating the difference between the adjacent elements and creating a new array with the resulting differnece. The last element should be colindant with the first one. example: firstArray=[0,1,2,3]; secondArray = newArray(); The second array will be: secondArray[0]: 1-0 = 1 secondArray[1]: 2-1...

How to refresh the Browserfield

I am using a class in which I am loading some text and images in browser field by using html tags.Now I want to change the text dynamically, how to refresh the browser field once after loading the screen. If I use onclick tag on html to detect the click event then How to use java scripts to do some functionality for that click event. I ...

Javascript string variable that contains PHP code

Hi, I basically just want to append a javascript variable to an HTML div with JQuery. However I need to append some PHP code as a string, it doesn't need to execute it just needs to show up as a plain old string string. The following code doesn't seem to append because I think it is still recognized as PHP syntax. var script = '<?php...

Dynamically set events and closure

This is a follow up question to my previous one: I have this object: var myObject { init: function(){ for (var i = 0; i <3; i++) { image = new Image(); . . . image.onmouseover = this.Fade(this, 70, 100,1); image.onmouseout = this.Fade(this, 100, 70,0); } }, SetOpacity: function...

Searching for a » character in a JavaScript RegExp

How can I search for a » character in a JavaScript regexp? Code that's not working right now: var extralinks = new RegExp('»','g'); div.innerHTML = div.innerHTML.replace(extralinks,'This is special punctuation'); Grazie! ...

ckeditor scrollIntoView to a div element within the editor

I have a navigation menu out side ckeditor and i want to navigate within the editor as all my element in editor have ids scrollIntoView how does this work any example will be good ...

Change Background Image of Div When Modal Popup Window Opens

Hi Everyone, I'm trying to dynamically change the background image of a div inside of a modal popup window. I first tried it with simplemodal and now I am trying it with the jqueryui dialog box. I can't get it to work on either one. Here is my code so far: //Jquery Dialog Attempt: //I have also tried it in the open event ...

Detecting DOM Ready State Within an iFrame (jQuery)

I have a script being run in a document that may or may not be nested in an iframe. I have sorted out the issue of detecting the nested, but I can't figure out how to detect the ready state of the DOM when it is an iframe. Here is what I have already: if (window.self !== window.top) { // is nested // DOM ready test here ...

A calender for Django DateField that only shows months and years?

Hey, In the django admin panel I currently have a DateField showing a nice Javascript calendar for inputting dates. However, I am only interested in the Month and Year. So I was wondering if it was possible to have the calendar only show the months and year. (Extra brownie points if you can restrict its usage so that no dates in the fut...

getElementById(array[x])?

I'm trying to put an array in to getElementById for a loop purpose. It seems to be not working, how can I do this? Edit: Sorry folks It says undefined. var lol=new Array( "test", "test2" ); var x = 0; while( x == 4 ) { number = parseInt(document.getElementById(lol[x]).value); x++; } And i have inputs id named test and te...

jQuery UI .sortable() with jQuery 1.2.x

Greetings, I'm in need of implementing functionality equal to that of jQuery UI's Sortable method: http://jqueryui.com/demos/sortable/ However, I'm not able to use a version of jQuery 1.3+. There is other functionality on the pages that is dependent on the older version which ceases to work when upgrading the older version of jQuery. ...

How to access devices on a client PC from a browser

What are the various ways to access devices on client PC - a barcode reader, a scanner, etc. - from a browser? I realize my users may need a plugin. These devices may have an API that is specific to their device; I would like to exploit their API if available (maybe Java, maybe C, maybe command line). ...

Test if ActiveX installed with Javascript?

Is there a way to test if an ActiveX control is installed using Javascript? ...

where does it call a pop up?

i am trying to find in this code where it instructs a new browser window? <div id="mlcalc-w1"> <div id="mlcalc-w2"> <div id="mlcalc-w3"> <div id="mlcalc-w4"> <div id="mlcalc-w5"> <link rel="stylesheet" type="text/css" media="screen,projection" href="http://www.mortgageloan.com/sites/all/themes/mortgageloan/css/tool/mlcalc-inline.css"&gt...