javascript

javascript REST client

is there a javascript library with REST or RESL-like (GET, POST, PUT and DELETE over http or https) capabilities? ...

is it possible to preview local images before uploading them via a form?

To be more specific, I want to use a form with one or more file input fields used for images. When those fields are changed, I'd like to show a preview of the associated image, before sending the data to the server. I've tried a number of javascript approaches, but I always run into security errors. I wouldn't mind using java or flash, ...

Delete a table row with javascript / jquery

This is not working. Firebug is not throwing any error though. HTML: <table> <tr><td>BookA</td><td><a href="javascript:deleteRow($(this));" class="red">Delete</a></td></tr> <tr><td>BookB</td><td><a href="javascript:deleteRow($(this));" class="red">Delete</a></td></tr> <tr><td>BookC</td><td><a href="javascript:...

Poedit regex based parser?

In our JS files we use the following format for Gettext translation: var str1 = '!t[The text that should be translated]'; var str2 = '!t[Some more text]'; This JS files will be parsed using PHP and the parsed strings get translated via Zend Framework Zend_Translate. The generated JS looks like this: var str1 = 'The text that should...

Preload javascript an Embedded player

If I have HTML with embedded code inside, for example a embedded player of YouTube, can I build in JavaScript, AJAX, etc. preloader for this player? Because if I have only the player embedded, the page is white in the loading moment, and later the player shows itself... ...

Having troubles preloading images with javascript

Hi, I'm trying to preload about 150 images and I want to be able to be able to do two things... 1) The images are being preloaded using a list of file names. Not every single file name in the list has a file to match up to it. eg) pic04.jpg may not exist, even if it is in the list. So when I'm preloading, i would like to be able to f...

ASP.NET textbox losing value after postback when value is changed client-side via javascript.

I am setting the value of a textbox via javascript client-side. When I refresh the page the value is lost. The textbox is not disabled or set to read-only. I have read suggestions to put the value in a hidden field, I'd prefer not to do this. It seems like a hack. The textbox is in a user control as such: <div id="Row" class="RaidRow...

Is there a way to read the clients machine/computer name from the browser?

possibly using javascript or asp.net? ...

Using variable keys to access values in JSON objects

The code: function updateDashboardData() { $.getJSON("includes/system/ajaxDataInterface.php", {recordcount:1}, function(data) { $('.stationContainer').each(function(data) { var bsID = $(this).attr("id"); var bsStatus = $(this).children('.stationStatus'); alert(data[bsID][0].time); bsStatus.find('.bs_maxH...

When you show and hide a div, will it re-adjust surrounding elements automagically?

When you show and hide a div, will it re-adjust surrounding elements automagically? Sort of how google maps http://maps.google.com/maps?hl=en&amp;tab=wl has that little icon where you can show/hide the left pane. Is it just making it visible with a animation effect or its more elaborate than that? ...

E4X filter by text content?

I'm trying to filter some XML in JavaScript using E4X and have some specific needs. Given the following: var xml = <body> <div> <p>This is some text that I have.</p> </div> </div>; I want to search the document for paragraphs starting with "This is some text". Currently I can the following to get at the ...

jQuery find whole number and append decimal

Need to take a SELECT drop down list options and find if any of the values are whole numbers, then append a .00 to the list value option. need to change the value as well. <select> <option value="1">1</option> <option value="1.99">1.99</option> <option value="2.99">2.99</option> <option value="4">4</option> </select> Thanks in...

how to select 2nd <LI> element using javascript?

Using JavaScript, how can I dynamically change one of the list-items below from this: <ul class="tabbernav"> <li class="tabberactive"><a title="All">All</a></li> <li class=""><a title="One">One</a></li> <li class=""><a title="Two">Two</a></li> <li class=""><a title="Three">Three</a></li> </ul> to <ul class="tabbernav"> <li class="tab...

can i highlight any text using Javascript other than the textarea and input text element?

using Javascript, it is easy to programatically select the text inside a textarea or input text element. How about for <span>The quick brown fox jumps over the lazy dog</span> is it possible to use JavaScript to select the words "quick brown fox"? Or select the whole sentence? ...

Why doesn't addTextObject() with a jQuery variable work?

When developing a Windows Vista/7 Gadget, and putting out text using addTextObject(), this works: var mytext = "Hello"; document.getElementById("background").addTextObject(mytext , "Verdana", 11, "white", 10, 10); But I cant get this jQuery selector into a variable to work: var mytext = $("#myid").text(); document.getElementById("bac...

How can I detect when the mouse leaves the window?

Hi, I want to be able to detect when the mouse leaves the window so I can stop events from firing while the user's mouse is elsewhere. Any ideas of how to do this? ...

Debugging not working in Firefox - Firebug

I'm trying to debug an extJS based JavaScript form in Firefox 3.0.8, with Firebug, but none of my debugging statements are working. console.log produces the error console is not defined in the console. The debugger statement just doesn't work. ...

Fast way to validate if all checkboxes are un-selected?

Is there a quick way or function that would tell me true/false if all check boxes are deselected? Without going through array? (with JS and HTML) All my check boxes have the same name... <form action="/cgi-bin/Lib.exe" method=POST name="checks" ID="Form2"> <input type=checkbox name="us" value="Joe" ID="Checkbox1"> <input type=c...

How to use YUI to locate an Input by Name and insert content after

How can I use YUI to locate a text input by name and insert a div after it? For example, this doesn't work: <input name="some_name" type="text"> <script> var el = new YAHOO.util.Element(document.createElement('div')); var some_element = document.getElementsByName('some_name'); // doesn't work .... replacing 'some_element' with 'docum...

Instantiate a Class dynamically via variable

How can I instantiate a class by throwing in a variable name? Consider this method inside a class: animate: function(el, build) { console.log(build.effect); var animationClass = new build.effect(el,build); }, Build is an object containing lots of stuff, but most importantly an "effect". This effect is the name o...