javascript

HTML/CSS: How to make "password" input show the password?

Hi, How can you make the value in the password field visible? So, when typing your password in the field, it will not show the black dots, but the actual value that you are typing. Thanks! edit: Ok, so then a better question might be: How can I force the browser to remember the value in this 'password' field and treat it as a password...

Extract last tagName of various Selectors

Basically I attempting to extract the last tag name of a handful of different css selectors. I have successfully implemented what I am talking about in javascript, I'm looking for a more compact way using only 1 regex expression preferably. Here is what I successfully have working. //Trim selector, remove [attr] selectors due to confl...

How to convert an unicode JavaScript string into a byte array using Mozilla services?

I have a service writing remote files, but it requires a byte array as input. Rest of the interface provides only JavaScript unicode strings. No way to write them then. I found something like this in MDC: var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createInstance(Components.interf...

HTML/CSS/JS: How to force browser to save password from a non-'password' type input?

Hi, The thing is that I have two values which are similar to a username and password, but are actually 2 randomly generated GUID's that users use to login to a website I made - they are not really a username and password, but with the GUIDs I try to replicate this combination. Usually browsers ask you if you want to save the provided l...

Disabling Hyperlinks

Some hyperlinks on my page have reasone to be enabled only when an element is selected inside a grid control. I have the chance to injects some code when a row is selected on the page and I would like to enable/disable these hyperlinks using jquery code. Any advice? ...

replace the textbox using innerhtml, here using html tag library

How can replace the column name, textbox and img with onclick event with innerHTML using JavaScript. samplecode: <tr> <td>Member Id:</td> <td><html:text property="memberValue" ... /></td> <!-- for memberValue setter&getter fun is there in bean --> <td> <A onClick="popUp()"> <html:img src="/calender.jpg ... /> </A> </td> </...

JavaScript function's memory size

This seems rather obvious to me, but I just wanted to make sure. In terms of memory used when the foo function is stored, would it better to do this: function foo(){ var hey = {}; hey.a = 1; hey.b = 1; alert('done'); } or function foo(){ var hey = getHey(); alert('done'); } function getHey(){ var hey = {};...

Looking for some ideas on how to create a graph from a sql table and output it to a webpage

I am familiar with vbscript, I am looking for a few ideas on how to do this. I am open to trying other scripting languages. The graph does not have to be incredibly fancy. Any suggestions would be greatly appreciated. ...

Post to another page site works, but shows a blank page in the process

I am posting values to from an ASP.NET website to a completely different site (Paypal actually). I accomplish this by returning a page to the user that has all the hidden form inputs written and then a Javascript function that automatically submits the form. The process is supposed to be seamless, but the blank page is noticeable for th...

How to change JSON object before send ExtJS

I everyone i have a JSON Array that is construct like this for (var i = 0; i < count; i++) { var record = myDataStore.getAt(i); if (record.dirty){ submitRecords[currentIndex] = record.data; //alert(submitRecords[curre...

I Can't get a dynamic radiobox value using Django

Hello everyone. I have a dynamic formulary that when a user types a query, it shows some radio box. And i get this error when i submit the form: MultiValueDictKeyError at /add_company/ "Key 'radioramo' not found in < QueryDict:... A sample of my javascript code: var elem = document.getElementById('div_field'); var radio_ramo ...

Is there a simpler way than this to calculate a straight in poker?

I have an algorithm for calculating whether a player's hand holds a straight in Texas Hold'em. It works fine, but I wonder if there is a simpler way to do it that does not involve array/string conversions, etc. Here's a simplified version of what I have. Say the player is dealt a hand that is a 52-element array of card values: var rawH...

jQuery best way to get JSON with ajax

I am developing an eshop and the client wants ajax. I think that this is a bad idea because its going be slow. However while viewing the products there are some filters on the left. When a user selects a filter some other should be disabled. For example there may be jackets for both males and female, but the red colour is only availabl...

Handle special characters in ASCII

Hello, My Javascript function returns a char arrya which might contain non-printable characters. In fact each character is a byte (represented as a number from 0-255). The problem is that when I try to copy this char array to the notepad, for example, I get these results: ORIGINAL STRING IN JAVASCRIPT: performance of thisĎask, ćd so mo...

PHP/Javascript: Tell two computers apart from same network

I'm developing a site where you are not allowed to login on multiple accounts on one computer, but I do not know how to do this. The method has to be: Cross-platform (can be used on Windows/Mac/Linux clients). Browser independent. This is to avoid some users exploiting multiple users to gain unfair advantages, while still allowing tw...

Force immediate DOM update modified with jQuery in long-running function

I have a javascript that takes about 2 seconds to execute (complex optimization algorithm). I want to set certain span to "working..." at the beginning of the function. I observe that the span doesn't change until the end of the function. How can I force DOM changes propagation? or should I approach this differently all together? I cal...

IFrame Facebook App Bring User to the Top of the Page

Hey, I currently have an iframe for a facebook application and I am using FB.Canvas.setAutoResize(); to resize it properly. The problem is when a user scrolls down and clicks on one of the lower links, it does not a way to bring the user back to the top. Is there a function or way of bring a user back to the top of the page? ...

Beating jQuery addiction: Which jQuery methods are easily translated into pure javascript?

Being spoiled by jQuery I now include it into every project even if all I need from it is to call $("#div).hide() or $("#link").click() once. I know that jQuery often takes care of cross-browser issues for you, but sometimes it is just a convenient wrapper for a native javascript methods. So my question is which jQuery methods can be e...

Using Javascript To Change The Very TYPE Of Tag

Let's say I wanted to change all <img> tags to <iframe> tags on a page. Could javascript be used for this purpose? Is there any way to change the actual tag type, or would I have to first delete the <img> and then create the <iframe>, if so, how can I make sure that the new tag has the same container as the old tag, etc? What's the ...

Is there an unobtrusive way to do make the condition of link_to_unless depend on the value of another form item?

I have this, and it works but it's pretty obtrusive. I am essentially mimicking tabs where each one holds one step in a 5 step process. If the previous step has been completed then I want the tab text to be a link, otherwise just text without a link. So the first step might be to select a service, which sets the service_id. If the se...