javascript

Problems with field validation script.

I have some javascript code that reads: $(this).keyup(function () { if(regex.test(this.value)) this.style.backgroundColor=config.validColor; else this.style.backgroundColor=config.invalidColor; }); This is supposed to provide a visual cue to the user, about the field he or she is typing in, however, this just flips the colou...

run javascript at serverside

Is there any way to run one same instance of JavaCcript(jQuery) on the server side and call it from a Java method? :) I am interested to know whether it is possible to run it on the server side (not clientside), like Google app engine. ...

Javascript error in IE

Hello =) My problem in ie browser only... auth.js Deferred.errorHandler = function(e) { alert('Unhandled error ' + e); }; function User() { SbApi.url = 'http://api.sindbad.ru'; var user = new SbApi('User'); ... IE console: 'Deffered not defined' on line 1 symbol 1 'SbApi not defined' on line 4 symbol 1 Any ideas? Thank you ...

make the div content autoscrolling right to left with a nice animation

Hi everybody, How can I make a div content (any type of content: table, image, text,etc.) autoscrolling from right to left with an elegant animation? Thank you very much, regards. ...

jQuery vs. javascript?

I recently stumbled upon some javascript forums (sadly, link is lost somewhere in the universe), where you could feel real hate against jQuery for not being... any good? Most arguments seem to make sense actually. Now, I really like jQuery, mostly for letting me concentrate on things I want to do rather on browser inconsistencies and i...

How to tell Django what's the active window

Out of an "old" tab, i'm opening a new tab in my django-powered web-app. Now, when submitting something in the new tab, it will still load in the old tab, however i want django to do all the stuff in the new tab/window (unfortunately, this also applies to popup-windows (popupwindow = new tab). How can i tell Django in which window it s...

close window from javascript

How to close the current window from javascript without any events like onclick or something else.. <script> window.close(); </script> The above doesnt seems top work.. Edit: i am opening a child window from a parent window and after some operation i want to close the child window and window.close(); doesnt seem to wor...

Javascript trivia: check for equality against the empty object

Probably a duplicate of this question. Silly javascript question: I want to check if an object is the emtpy object. I call empty object the object that results from using the empty object literal, as in: var o = {}; As expected, neither == nor === work, as the two following statements alert({}=={}); alert({}==={}); give false...

JavaScript Bookmarks for a story

I'm working on ePen, an editor for novels which can create an HTML export. To make it easier for readers to follow the story, I thought about supporting bookmarks which are visible on the page (so you can mark part of the text or drag an image somewhere where it sticks). The information should be saved in a cookie and reloaded when the r...

Disable Anchor tag and remove underline also in javscript

I have a anchor tag which I would like to disable or enable depending upon some condition. I am able to achive this using the following function function disableEnableAnchor(obj, disable) { if(disable) { var href = obj.getAttribute("href"); if(href && href != "" && href != null) obj.setAttribute('...

How do I cast a decimal number to String in Javascript?

325.234 to string? is it toString()? ...

Is there a way to break long numbers ("$100000000") into more readable triads ("$100 000 000") with CSS?

I have a page with lots of big number values. Millions and billions of dollars going everywhere. And it is hard to read these numbers, so my client asks me to break them into more readable chunks of three symbols, "$100000000" => "$100 000 000". This is completely reasonable request, but the problem is that I do not want to do this on s...

ASP.NET MVC Forms with both AJAX and traditional POST support

I have a form that I currently enumerate with some Javascript functionality and then post it with jQuery .ajax() to a MVC controller action. I have few questions on my options if I wanted to add traditional (no-javascript) support for posting this form. 1) The thing is I have some data that is not in fields but it is just text in divs....

How to return the order that an item appears in a list in jQuery?

I am trying to find out how to find the position that an item appears in a list. For example: <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> If I clicked on item 2, I would want to receive '2'. Is this possible? ...

Typeface.js not rendering in Internet Explorer

Hi, just wodering if anyone has experience with Typeface.js ( http://typeface.neocracy.org ) and fixing issues of the font not being rendered in Internet Explorer ( 6, 7 and 8 ). The font renders in Firefox and Safari fine, hover nothing is displayed in the Explorers. The font is not installed locally so I know that the script is workin...

rhino serverside js licensing

any future plan for rhino to change licensing to lgpl? currently it is gpl, also mean if we use it we required to open source our application right? ...

I like the x-ray overlay but hate all the images.

ok the X-ray link is http://www.westciv.com/xray/ and want to have an overlay like it. It is easy to do but without all the images is simple but there is over 2000 lines and I cant keep up with removing its styling extras on-top. I would like some small code so it can go in my main javascript file because I already have 200 + lines min...

Sifr 3 clears form fields on page refresh

I am using the latest sifr 3 and am encountering an unusual problem. typically when entering text into a form field if you refresh the page the browser retains this information. The situation i am experiencing is that if there is a sifr element before the input field then it will not keep this information and the field will be blank on...

Comaring two different date formats

Hi, I have a 2 different date formats. 1) dd/mm/yyyy 2) dd-mm-yyyy I want to compare these 2 date formats in Javascript or Actionscript. Is it possible. Thanks, Ravi ...

javascript / IE 6/7: check if within an iframe

I have a page which needs to check whether it is contained within an iframe or not in effect whether the page is the top page. I tried doing this: if(window == window.parent) and it works for Opera, FF, and Chrome but not for IE. is there some trick in IE I should use? ...