javascript

Sequential animations in Jquery

I see a lot people struggling with this(me included). I guess it's mostly due to not perfectly knowing how Javascript scopes work. An image slideshow is a good example of this. So lets say you have series of images, the first one fades in => waits => fades out => next image. When I first created this I was already a little lost. I thi...

Mixing jsf el and Javascript

I was wondering if anyone out there knew of a way to have EL expressions in included JavaScript files be evaluated by JSF. I was hoping that Seam might have a way around this but no luck so far. All I want is to be able to use localized messages in my Javascript functions which are shared across pages. ...

Why doesn't an octal literal as a string cast to a number?

In JavaScript, why does an octal number string cast as a decimal number? I can cast a hex literal string using Number() or +, why not an octal? For instance: 1000 === +"1000" // -> true 0xFF === +"0xFF" // -> true 0100 === +"0100" // -> false - +"0100" gives 100, not 64 I know I can parse with parseInt("0100" [, 8]), but I'd like to ...

Why is the jQuery backgroundPosition animate function jumping instead of animating?

I'm trying to create 3 buttons (image is a background image) that animate smoothly when doing a mouseover. When I'm using the following html, css and js, the result is a jquery animation where the animation just jumps to the result in stead of creating a smooth animation towards the result. See the result at: http://infinitize.com, cur...

JqGrid setCell method, inserts blank row in the grid

I have a portion of code to update a cell value like this: jQuery("#myGridDiv").jqGrid('setCell', myRowToEdit, myColToEdit, myNewValue); that's about it, and sometimes it happens that a blank 'dummy' row is inserted at the end of the grid, this behavior is somewhat random but occurs often, any help will be really appreciated ...

how to dynamically replace css?

I've got an image on the page (class='image') within the div (class='galleria_wrapper') and want to place a caption (class='caption') at the lower right corner under that image. The image could be vertical or horizontal, and making a fixed padding-right value let's say .caption<{float:right;padding-top:5px;padding-right:90px;} is n...

Setting zoom level on mobile browser

I am designing website for mobile access and I want to set page width, height and button sizes, so they display filling up the screen. For example if user is using HTC HD , the whole screen would be 480x800 with button sized 240x200. However IE mobile as well as Opera load the page with some zoom level, so the buttons display either too ...

Why has Javascript been (mostly) only a browser-side technology for more than 10 years?

Recently there is a lot of projects that pushes Javascript into other directions: as a general purpose scripting language (GLUEScript, Rhino), as an extension language (QTScript, Adobe Reader, OO Macros), Widgets (Yahoo Widgets, MS Gadgets, Dashboard), and even server-side JS & web frameworks (CommonJS, Helma, Phobos, V8cgi), which seems...

Go Back to Previous Page

I am using a form to "Rate" a page. This form "posts" data to a php script elsewhere. I simply want to display a link after the form is processed which will bring the user back to previous page. Can I do this using javascript in my php script? GF ...

how to check from JavaScript if loaded page has ASP.NET authentication cookie?

It looks like JavaScript does not have access to authentication cookies ('ASP.NET_SessionId', '.ASPXFORMSAUTH') in the http headers I can see cookies but document.cookie object does not have them. ...

How do I use JQuery to disable a submit button?

So that it's no longer clickable. ...

Change table row display property

I have an html page with a table that contains a hidden row: <table> <tr id="hiddenTr" style="display:none"> ... </tr> </table> I need to make it visible at client side using jquery. I tried this $('#hiddenTr').show(); and this $('#hiddenTr').css('display', 'table-row'); Both implementations don't work for me. Furthemore...

How to check if an HTML element is supported by a browser

Hi Is there a way to check if a tag is valid html tag and / or supported by the browser ? Like if I type text "hi" in a set of p1 tag, browsers wont show anything in display, but p1 is not a valid html tag. How to check this using javascript ? ...

Show the focused div only bookmarklet

I'm searching to select a text from a div, then click on a bookmarklet that remove all html parts in the body except the div where the text is selected maybe jquery can help with something like : javascript:var%20s=document.createElement('script');s.setAttribute('src',%20'http://jquery.com/src/jquery-latest.js');document.body.appendChi...

Dynamic table memory usage

I use a dynamic table: <html> <body> <button id="button">Build table</button> <div id="container"> <script type="text/javascript"> window.onload=function(){ var table = null; var row = "<tr><td>111111111111111111111111111111111111111111111111111111</td>" + "<td>222222222222222222222222222222222222222222222222222222</td>" +...

How to feature-detect/test for specific jQuery (and Javascript) methods/functions used

good day everyone, hope yer all doin awesome am very new to javascript and jquery, and i (think) i have come up with a simple fade-in/out implementation on a site am workin on (check out http://www.s5ent.com/expandjs.html - if you have the time to check it for inefficiency or what that'd be real sweet). i use the following functions/met...

How do I animate text links using jQuery?

I am somewhat new to jQuery and I have a problem with something I am trying to implement. I have a vertical navigation menu where each link animates on hover by changing color, increasing letter spacing, and adding a border on the left. Everything is working the way I want it to except for when I click on the link. After I click on the...

Scripted iFrame loads contents over current page instead of within an iFrame

I'm trying to load a webpage into an iFrame while keeping a content bar on top, but for some pages that I try to load into the iFrame the contents is loaded as if I navigated to that page. I use the following code to dynamically load an iframe: $('#my_iFrame').attr("src","http://www.nytimes.com/2010/03/26/opinion/26ryan.html"); It lo...

What's the difference between reflow and repaint?

I'm a little unclear on the difference between reflow + repaint (if there's any difference at all) Seems like reflow might be shifting the position of various DOM elements, where repaint is just rendering a new object. E.g. reflow would occur when removing an element and repaint would occur when changing its color. Is this true? ...

looping through an object (tree)

Is there a way (in jquery or javascript) to loop through each object and it's children and gandchildren and so on. if so... can i also read their name? example foo :{ bar:'', child:{ grand:{ greatgrand: { //and so on } } } } so the loop should do something like this... loop start if(nameof == 'ch...