javascript

Javascript toFixed localized?

Do you know if toFixed is a localized function? I mean will this: var n = 100.67287; alert(n.toFixed(2)); show "100.67" on english US OS/browsers and "100,67" (with comma) on Italian OS/browsers (Italian or any other local system that uses comma as decimal separator). Thanks! ...

how to restrict user to copy web content

I am creating a web site and my client demands to restrict user to copy TEXT displayed on the web page.how can I do that? I am using PHP and HTML in my application. ...

Javascript Event Bubbling Not Working As Expected

Hi Guys, Having a nightmare trying to figure out event Bubbling.. Full test case: <html> <head> <script type="text/javascript"> function $(ob) { return document.getElementById(ob) } function bodyClick() { $('win_clicks').value = parseInt($('win_clicks').value) + 1; } window.addEventListener('load',function(e) { $('bl_lnk').ad...

How can I make my divs stay the same size depite adding content?

So I imagine this is a pretty trivial question for most, but I am working with a grid like class of divs, and whenever I dynamically add content to one div, the whole row of remaining empty divs shifts down. There may be something that I am just not understanding about divs, but after doing some research on the web, one post said there ...

Submit form without page reloading

I have a classifieds website, and on the page where ads are showed, I am creating a "Send a tip to a friend" form... So anybody who wants can send a tip of the ad to some friends email-adress. I am guessing the form must be submitted to a php page right? <form name='tip' method='post' action='tip.php'> Tip somebody: <input name="tip_e...

YUI DataTable custom sortFunction issue

I am using a YUI DataTable with a custom sortFunction that strips out HTML code, to sort based on the text content only, rather than the entire string with HTML tags. The problem that I am having is that I need to make use of this sort function on three different columns, and I can not seem to pass the "field" value into my sort function...

How can I make dropdown menu main item stay in position?

I've built a menu with Superfish v1.4.8. Everything is fine but I need to show menu item's hover state when mouse is over its drop-down items. In case I want "Ürünler" to be at its hover state when it's dropdown menu is open. Site can be seen here. ...

FckEditor in Rails: textarea problem + ID

Hey all, I'm using the FCKEditor in my Rails app and everything works as it should except for ... 1] When putting a textarea into the fckEditor, saving it and going back to the page, everything after the textarea is posted below the FCKEditor as plain HTML code. So when I resave, everything after the (first) textarea is lost. Anyone ever...

Highlighting text in a textbox using Javascript

Hi, I have an ASP.NET 2.0 webapp (with C#). I wanted to add a button which, when clicked would highlight selected text. By 'highlight', I mean change the CSS properties of the text so that it can stand out. I think this can be done with some clientside JavaScript. I know that you can assign a Javascript function to the onclick event of...

jQuery delay doesn't work as expected

I have the following jQuery code $("#dropdown").hover(function() { $(this).stop(true,true).fadeTo('fast',1); $("#options").stop(true,true).slideDown(); }, function() { $(this).delay(1000).stop(true,true).fadeTo('fast',0.1); $("#options").delay(1000).stop(true,true).slideUp(); } ); What I expec...

jQuery global variable best practice & options?

Currently I am working on a legacy web page that uses a ton of javascript, jquery, microsoft client javascript, and other libraries. The bottom line - I cannot rewrite the entire page from scratch as the business cannot justify it. So... it is what it is. Anyway, I need to pollute (I really tried not too) the global namespace with a v...

javascript ok/cancel dialog box appear once per session

I am trying to get this to work in my iweb page hosted not on MobileMe. With the code below I continue to get the alert box on each refresh of the page instead of once per session. I am a total newbie here so be kind please. //Alert message once script- By JavaScript Kit //Credit notice must stay intact for use //Visit http://javascript...

Finding the Source Line of a function call

I've built a custom logging utility which displays a Log Message and the DateTime. I would like to add the line number in the source code which called the function. Is there a way to determine which line of the HTML source a particular javascript function was fired? ...

Is it posible to use "confirmit" to open new url in the same window?

I'm using a the confirmit java script function to redirect to a new url with a positive response. It doesn't do exactly what I want - and maybe I can't have exactly what I want. Here's what it does - onunload, with a positive response it opens the new url in a new window, which can be blocked by a pop-up blocker without the user even k...

Deobfuscating Javascript

What is this monstrosity? Anyone know of a way to make it readable? <script type="text/javascript"> //<![CDATA[ <!-- var x="function f(x){var i,o=\"\",l=x.length;for(i=0;i<l;i+=2) {if(i+1<l)o+=" + "x.charAt(i+1);try{o+=x.charAt(i);}catch(e){}}return o;}f(\"ufcnitnof x({)av" + " r,i=o\\\"\\\"o,=l.xelgnhtl,o=;lhwli(e....

How can I force a jQuery plugin to refresh the data it has loaded?

I am working with jQuery Pagination, and a popup form. On saving the data in the form, how would I go about forcing the Pagination plugin to reload the data it would load for whatever page I am on, without reloading the entire webpage? Ex: Item 1 Item 2 Item 3 Add Item->Item 23->Save->Reload List Item 1 Item 2 Item 3 Item 23 http://d...

What is necessary to run JavaScript files from MS Server 2003?

I have created some JavaScript files and they run well from my Mac OS X Server. Now I have put the same JavaScript files on my MS Server 2003. But they don't work. Do I have to install something on the server in order to get them work? EDIT: (Sorry, I'm new and English is not my native language, so its hard for me to describe the situa...

What Javascript graphing package will let me plot points against a user-selected coordinate system?

My customer has some specific requirements for a graph to show in our web app. We use HighCharts elsewhere in the app for more traditional graphing, but it doesn't seem to work for this situation. Their requirements: Allow the user to select a background image, set the scale and origin of the coordinate system. We'll graph our point...

Limiting Number of Characters in a ContentEditable div

Hi guys, I am using contenteditable div elements in my web application and I am trying to come up with a solution to limit the amount of characters allowed in the area, and once the limit is hit, attempting to enter characters simply does nothing. This is what I have so far: var content_id = 'editable_div'; //binding keyup/down events...

jQuery .getJSON() Not Parsing All Objects

I'm using jQuery's .getJSON function to parse a set of search results from a Google Search Appliance. The search appliance has an xslt stylesheet that returns the results as JSON data, which I validated with both JSONLint and Curious Concept's JSON Formatter. According to FireBug, the full result set is returned from the XMLHTTPRequest,...