javascript

JQuery: Select Elements changes tracked but not their values!

Hello all, I have just got a questioned answered and have fallen into another trap! I have a form which is in a lightbox and I want to track every change in the select elements. When they change I want to get the value of each of the select elements. I have tried to do the following: $('select.htt, select.hst').live('change', function...

Retrieve information from pop windows

Is there a way to popup a web page, and retrieve some information from the page as it is being closed or before being closed? I have done me homework and know about jquery popups etc, but I want something I can learn the basics from. /vfclists ...

Jquery .height() Inconsistent Results on Page Reload

I'd like to adjust the margin of container divs and the padding for links within a list so that the last line-item is as close as possible to the bottom of a variably sized image next to it. The function works exactly as I had expected when the page loads the first time. However, if the page is reloaded, the .height() and .outerHeight(...

Jquery unwrap() method?

There is a great method in jquery called wrap() that will wrap a selected element inside a new element, like so: Start with: <p>I wish I was wrapped!</p> Add code: $("p").wrap("<div></div>"); End with: <div><p>I wish I was wrapped!</p></div> But what I need is something that will unwrap, so that the above process is reversed....

Send data to server

I am developing an app for the iphone.The thing is that i want to send the values of longitude and latitude i get from the phone using javascript to a server commanding it to search for something.Do i have to read about cross domain stuff?How could this be done? I know that i can use Ajax but it can serve me if i refer to the same domain...

Extract list of supported HTML or X11 colour names and their RGB values using javascript

There are places to get lists of HTML or X11 colour names and their RGB equivalents. For instance we can find that "Aquamarine" is "#70DB93". Presumably the browsers know the mappings. Is there a way to use javascript to interrogate the browser and get a list of which colour names it supports (along with the RGB the browser plans on u...

Should I learn Firebug or IE8 Developer Tools?

I need to learn either Firebug or IE Developer Tools in a hurry, and I could use some advice about which one is better. I'll be using either one to debug some JavaScript, primarily with repsect to an XHR mystery. Any tips about which one to choose would likely save me lots of time and would be most appreciated. EDIT: I already use Fid...

jQuery shadowbox video not working in IE7

The shadowbox video plugin is not working in IE7 although it works fine in Firefox and Safari. Any comments would be really appreciated. Site: http://www.carolinedawes.com.au/update/abc-gardening-australia.html HTML: <a href="m/abc-gardening-australia-caroline-dawes.mov" rel="shadowbox;height=272;width=480"> <img src="i/abc-garden...

what grid system does swivel.com use?

What grid library does swivel.com use? It looks pretty nice. Is it made inhouse? In other words, what good JS grid libraries are available? ...

Can Javascript code be copyrighted?

I'm writing an application that is largely javascript based. The javascript uses a java applet on the page to work as a socket bridge. However, if someone was to steal the javascript code I have written, would that infringe on copyright laws? What if I attached a license at the top of the .js file? I was thinking of writing the applicati...

Specifying Where To Focus Within Textarea

I have a textarea... <textarea> Some writing here * Then some more on another line </textarea> What I want to do is focus the user where the * is. Is this possible? ...

A tricky GPL problem with Javascript obfuscation

Hello, I am developing a javascript API which is planned to be released LGPL early 2010. I want to release a prototype in the form of a wordpress plugin which uses my new API. I want to host this plugin on Wordpress' official plugin site. Wordpress only hosts plugins which are compatible with GPL. Ideally I would just supply an obfu...

onchange event doest not bubble in MSIE. Where do I find a chart listing all such events.

I just found out that onchange event does not bubble in MSIE. I hopped to http://www.quirksmode.org/ to see if I could find other events which are not supported by IE. However I do not see any chart listing onchange event as an event that does not bubble in MSIE. Where can I find such a char? ...

Variables in Anonymous Functions -- Can someone explain the following?

I've been trying to assign a function to onclick event of a dynamically created "a" tag in JavaScript. All of the tags are created in a loop as follows: for ( var i = 0; i < 4; i++ ) { var a = document.createElement( "a" ); a.onclick = function( ) { alert( i ) }; document.getElementById( "foo" ).appendChild( a ); } The alerted v...

mootool display image

i want to display image after it upload using mootools i write following code but it did't work onFileSuccess: function(file, response) { var json = new Hash(JSON.decode(response, true) || {}); if (json.get('status') == '1') { file.element.addClass('file-success'); } else { ...

JavaScript: Find vertical pixel position of particular string in textarea

I have an HTML textarea as a basis for a small text editor running inside Chrome, which includes search functionality (as I need search features beyond what the browser offers). For longer texts, this means I need the JavaScript to scroll to the correct position after selecting the found text. This works fine by calculating the font's li...

regex / instr javascript function to check url

Hi I have 8 possible URL structures that I need to check in my javascript code and then run a function if the current page meets the correct criteria. There are 8 possible variations of the URL and all will include the keyword questions, so the first check needs to isolate and identify if the current page has the keyword 'questions' in...

Posting with jQuery

How would I do this in jquery? I would like to post data, process, and then retrieve the page that is generated by that data. All I can find are seperate just post. or just retrieve data. ...

How to know what percentage of visitors to a website don't use javascript?

Is there an easy way to find out what percentage of visitors to a webpage are not using javascript? ...

Passing PHP variable to Javascript dynammically added textbox

hello i have a javascript function like this: function addfamily(divName){ var newdiv = document.createElement('div'); newdiv.innerHTML = "<input type='text' name='family[]' size='16'>"; document.getElementById(divName).appendChild(newdiv); } which dynamically adds textbox to the form and a php script like this: <?php $...