javascript

i18n in javascript using .properties file

Hello: I'm developing a web application with JSF, so I use a Java Properties File (i.e. resources_es_CO.properties) to localize strings for the application and this is working OK. Mi question is: how can I call localized strings in this kind of files from my javascript validations so alerts show those localized strings to user? Thanks ...

using Jquery to show one error message at a time

Hi, I'm trying to show one error message at a time and then once that error has been corrected to show the next error. For example there is validation on three textbox (Date, Month & Year) once the date textbox is valid then the month error message choudl show. The code I have so far for this is: var pi_ArrayValidationResult; var pi...

CSS, Internet Explorer 7: layout messed up when I click on a menu

hi, In Internet Explorer 7, when I click on the menu in 'Categories' block, my website content slides to left. Could you help me to debug this ? http://69.90.160.65/~o110334/ thanks ...

jQuery selector NOT

How do i select everything BUT the element with an id? <div id="test"> <p id="test"></p> <p></p> <p></p> </div> I want to be able to select the second and third ...

html, css, execute javascript from a gif file .

I would like to know if it's possible to execute javascript from embedded .gif file . I can make rewrite to a php file to seem as a gif file and execute the code from there but I'm not faimilar with css/html therefore I was wondering if there is any trick to make seem there is embedded a picture but to execute javascript . I tried img sr...

capturing the element in javascript

i would like to display the error message in the input element itself instead of showing an error message separately. how would i capture the element in which the message needs to be displayed? this the code: function checkForm(form) { if (yname.getValue() == "" || yname.getValue() == "Your Name" || name.getValue() == "" || ...

How to find Masterpage height and width using javascript

Hi How to find Masterpage offsetheight and offsetwidth using javascript ? Regards, kumar ...

The value of 'this' inside of a Javascript prototype function used as an event handler

I'm trying to use prototype inheritance in Javascript. The problem with my code below is that when the button is clicked and MyNamespace.MyObj.myEventHandler is called, the value of this is not the instance of MyNamespace.MyObj, but is instead the button that was clicked. Am I structuring things wrong (is there a better way)? Can I so...

How to make jQuery autocomplete execute a search() when user hits submit.

As a follow on my from last post - http://stackoverflow.com/questions/3307520 . I decided to make a new question rather than to continue editing that one. I currently have jQuery ui autocomplete 1.8 (or so) working reasonably well, except from one thing. If the user just enters a (valid) name and hits submit, the auto-complete lookup ne...

JS not pushing to array

Hey guys, Trying to push some coordinates, as well as some stuff specified in a form by the user, to an an array called "seatsArray". Here's my code: <div> <img onLoad="shiftzoom.add(this,{showcoords:true,relativecoords:true,zoom:100});" id="image" src="plan1.bmp" width="1024" height="768"> </div> <script type="text/javascript"> var s...

jquery reusable component?

I have a bunch of methods that make use of jquery to basically generate a list view. The problem is I need to use this thing multiple times, so I need to make it reusable. Should I just write a jquery plugin? Should I write a non-jquery plugin Js Object (like a class in non-prototype languages) and just create instances as I need? ...

Easiest way to parse a Javascript date in C#?

I see that JSON.NET has a DateTime converter: string javascriptJson = JsonConvert.DeserializeObject(entry, new JavaScriptDateTimeConverter()); However I don't have a JSON object, I simply have a string: /Date(1276146000000-0500)/ I could create an object, add the date, then parse it, but this seems common enough that there should b...

How to test whether a browser accepts cookies with JavaScript?

I want to test with JavaScript whether the browser supports cookies or not. The following code works with Internet Explorer 8 and Firefox 3.6 but not with Google Chrome 5. function areCookiesEnabled() { document.cookie = "__verify=1"; var supportsCookies = document.cookie.length > 1 && document.cookie.indexOf...

How big is "too big" for a javascript file

With all the awesome jQuery plug-ins out there, it's so tempting to just start including them all over the place to enhance the look of our website. I'm looking for some opinions on whether and when I should be concerned about the sizes of these scripts. Assume they're being cached on the web server level, so I guess the potential co...

CSS/Javascript: How to count the number of displayed lines of an element?

Is there a simple way to count the number of lines of a display:inline-block element? I need to know how may lines the child elements are arranged into. Thanks! ...

How to achieve this menu?

Are there any tutorials (some JavaScript framework perhaps?) that will explain how to produce a top-level menu like the following? http://www.clinique.co.uk Where the drop down part can be any width and can contain images/links. ...

jQuery methods on original javascript object?

Did jQuery add any sort of new functionality to internal JS object like the "anchor" object? I know you can select via $("a"), but what happens if i already have an object selected? ...

Jquery obtain delay untill loading

Hey there 1. on this code, which loads flash onmouseenter, how can i get some kind of delay, (could use a loading image), untill the browser loads the flash. I have 10 different sections. If i move the mouse fast between them, flash is loaded several times and it brakes down eventually. $(".section").mouseenter(function() { $(this...

Javascript Date.parse help

I am using Javascript Date.parse() to check if a start time is after an end time. The time in question is like this: Date.parse("12:00pm") > Date.parse("9:30pm") In Chrome this is coming up as false (as it should) In IE it is incorrectly coming up as true. The values Chrome see's are: Thu Jul 22 2010 12:00:00 GMT-0400 (Eastern Day...

jQuery working out wrong height, due to @font-face

I have a problem with jQuery and @font-face. I need to work out the height of a <div>, which works fine, but then there is a small delay for the fonts to load and as soon as they do, the @font-face fonts were actually bigger than the fallback fonts, so the height is smaller than it should be. I have tried using Modernizr, but that is n...