javascript

Javascript Sort SELECT Elements

Is there an easy way to sort a list of HTML Select elements in Javascript? I would want it sorted by their names. Each Select element has other fields like title and value. Would I have to use arrays? ...

Console.log messages not showing up in Chrome's javascript console?

I am logging using the jQuery.log plugin (which logs to console.log if available) and I am not seeing any of the logging messages appear in the Chrome JavaScript console. Logging works on Firebug's console under Firefox, but I did have to explicitly enable the Firebug JavaScript console. Have a missed some option somewhere under Chrome...

need help with nested jquery function

Hi Please find my code below. My problem is that I the inner jQuery.get() doesn't get executed. Could some one help me out with this? jQuery(document).ready(function() { $('.error').hide(); $(".button").click(function() { // validate and process form here $('.error').hide(); var zipCode = $("input#name").va...

Whats the best approach to making a web application for drawing on and modifying an image?

Whats the best approach to making a web application for drawing on and modifying an image? Should be able to draw on, add text etc. I have been hearing a lot about SVG, but is that a required download for the user to view the application then? Whats the best way to handle this? What language? etc. Thanks! Preferred: PHP jQuery java...

grab javascript function arguments

how can i grab the arguments of a javascript function? below is my code, <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-45-9"); pageTracker._trackPageview();pageTracker._addTrans("3128", "", "20.4600", "0.0000", "8.1900", "SFO", "CA", "US"); pageTracker._addItem("3128", "23317", "Cheese ", "", "6.2900", "1"); p...

How to get HTML data with javascript

Hello, I have an HTML web page full of divs and span tags identified with class that have lots of data I need in other format. I was wondering what would be the best way to do this with javascript. Thank you for the help. ...

GWT BOOTSTRAP - Question

Reading the GWT Bootstrap on Googles page, i have some question. (http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_WhenDoModulesLoad ) Assumptions: Most browsers will allow a maximum of two simultaneous connections for fetching resources. The HTML Page: <html> <body onload='alert("w00t!")'> <img src='bigImageZe...

Javascript is passing an Array of Objects instead of an Array of Arrays...

I'm passing a Javascript Array() to Flash via FlashVars but Flash complains. Can you guys point me what am I doing wrong here? javascript code // array with the user defined cities var usercities = new Array( {'nome':"London", 'lat':51.5002, 'long':-0.1262 }, {'nome':"NYC", 'lat':51.5002, 'long':-0.1262 } ); flashvars.newcit...

window.opener null after redirect?

So I'm adding a "sign in with Twitter" button onto my web site. I display the twitter sign in in a popup window. When the user signs into to twitter they are redirected back to a page on my site which calls a javascript function on the window.opener to notify the page that sign in has completed and to refresh. The problem is after twi...

Loop through All Objects of a Class

Let's say I have some class called loopObject and I initialize every object through something like var apple = new loopObject(); Is there anyway to loop through all objects of a class so that some function can be performed with each object as a parameter? If there isn't a direct method, is there a way to place each new object into an a...

Recognize the 2 key from the keyboard or from the numpad

Hi, I would like to add keyboard short-cuts to my web application. But for one of them, I need to be able to distinguish between the digits entered with the numpad from the one entered above the qwerty chars (my use case is for French keyboards, so it's azerty, but I don't think it's a problem). I'll combine it with a detection of the ...

Generating a jQuery UI progress bar

I'm using a 3rd party service to process images and they provide a handy jQuery plugin. The plugin can output feedback on the upload transfer, and I would like to display this as a nice jQuery progress bar from the jQuery UI. Here is the example they give, which currently just shows the transfer status as text: $('#MyForm').transloadit...

default selected option for html select using javascript in IE

Hello I have a select element and I am trying to set a default option for that select element. But my code isn't working in IE. Is there any way around for this?? if(objOption.value == selectedoption) { alert(objOption.value); objOption.defaultSelected = true; } I am able to retreive the option, and its value, but am unable to set the...

html script tag not using type javascript <script type="text/html"> ?

I was checking out the source on an html page and came across this <script id="searchItemTemplate" type="text/html"> <# var rows = Math.floor((Model.RecordsPerPage - 1) / 3 + 1); for (var i = 0; i < rows; ++i){ var startIdx = i * 3; var endIdx = startIdx + 3; #> //etc .... </script> I have never seen ...

Meebo Bar: open a widget automatically

With the new meebo bar, you can add your own widgets inside it. I want to integrate my app as widget to use in my website. But there's a lack of documentation, like open automatically my widget when enters in my page. Anyone has experienced it? ...

Include PHP inside javascript (.js) file

I have a javascript file (.js file, not HTML file) containing several js functions. I want to call one of the PHP functions in a PHP file containing only several PHP function from within one of the js functions. Is that possible? Would I need to "include" the .php file containing the php function in the .js file? How would I do that?...

How to zoom content of a web page?

How to zoom content of a web page? Like for example on familyecho.com you can zoom in and zoom out. How do they do it? ...

Convert plain text into <input type="text">

Hello, I have multiple readonly textboxes like this <div id="box"> <form method="post" action=""> <input type="text" readonly="readonly" name="1" value="A" border="0" /> <input type="text" readonly="readonly" name="2" value="B" border="0" /> <input type="text" readonly="readonly" name="3" value="C" border="0" /> <input type="tex...

Updating multiple elements from one selector?

Hello, I would like to update multiple elements(with different values) from the same selector. What would be the easiest way to go about doing this? I have tried $(document).ready(function(){ var t=$('.test input'); t[0].val('Foo'); t[1].val('Bar'); }); with this HTML <div class="test"> <input type="text"> <input type=...

Length of a JSON object

This function is generating a array with json objects on it: var estoque={}; function unpack_estoque(tnm,total,estoque_vl,id,tid,st) { tnm=tnm.split("|"); total=total.split("|"); estoque_vl=estoque_vl.split("|"); id=typeof id != 'undefined' ? id.split("|") : null; tid=typeof tid != 'undefined' ? tid.split("|") : null...