javascript

add "readonly" to <input > (jQuery)

How can i add "readonly" to a specific <input >? .attr('readonly') does not work. ...

Problem with special characters when Minifying JS

Hi! I'm using MVC ScriptManager to Compress and concatenate all my .js files. It works very well, except that if a *.js has a special character such as "á, à" it turns to "Ã!". I'm trying to change the source code but with no success so far. Does anyone have an idea what this could be? Thanks!! ...

In php, is it better to use includes or not when a controller class is being used to talk to javascript?

I have a javascript file that communicates to a controller class, which in turn delegates which function to run to a transactions class. Is it better to have the transactions class broken up into multiple smaller files and then in my switch statement include which ever smaller file i need? or should i have all my transactions in one fi...

problem with variable (firefox extension)

I try to make firefox extension, that display two buttons: 1 and 2. When you press button1 to var path get value, that is address of current open page, then new tab is opening becoming active. In this tab there is button2, that allow to put (innerHTML) value of var path (this address of first tab). And now the problem: button1 uses funct...

Mocking a useragent in javascript?

I'm looking for a way to programmatically change navigator.userAgent on the fly. In my failed attempt to get an automated javascript unit tester, I gave up and attempted to begin using fireunit. Immediately, I've slammed into one of the walls of using an actual browser for javascript testing. Specifically, I need to change navigator.use...

Selecting Multiple Options creates Multiple Inputs

I have a select field in a form that allows you to select multiple options. I need to create a new input textbox for every number of options selected, automatically. For example, if you select on option in the select box, one input will appear below it. If you select 5, 5 inputs will appear below it. I'm not sure if this can be done ...

Unloading/Removing content from an iFrame

Is there anyway to unload a page that has been loaded inside of an iframe? I do not want to have to change the iframe src to a blank page if possible. I am basically looking for something that will do something like this $('#frameID').attr("src",""); except that code does not seem to clear the previously loaded page. Is there a "unload"...

Keyboard navigation with Jquery

In Jquery, how can I set an event such that when user is browsing some pictures, and presses the left/right arrow key, it calls a function which can be used to show the previous/next photos? I only need to know how to check if the key pressed was the right/left arrrow key and ignore all other key preses. The image will be in its own div...

Assign an existing javascript array to a property in object notation...

Hi, I'm localizing a menu and I want to assign a declared array to an object property in that way: var menuListLocal=["Home","Play","Options","Exit"]; var menu_Controller={ _menuList: menuListLocal, // .... // } Sorry if it is too obvious. Thanks. ...

How does one save a variable in a Tab for use with one's Firefox extension?

I am writing an extension that opens new tabs and I need to save the value of a var in the current tab, such that it will exist even if the user restarts Firefox. How can I do this? ...

Why are javascript comments downloaded to the browser?

Using aspnet 3.5. I have some javascript functions in my aspx file. Why do the javascript comments get passed to the browser? It makes the download file unnecessarily large. ...

Javascript code does not work in Firefox

hi friends, In the image click I write code for invoke java like this <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> <table cellpadding="0" cellspacing="0" width="311"> <tr> <td height="14"> <img onclick ="SignIn();" border="0" src="../images/Sign_In.g...

Showing jQuery calendar in a jquery dialog popup

Does anyone know of a way to show a jQuery calendar in a jQuery dialog? The calendar seems show behind the popup dialog. I tried adjusting the z-index of the outmost calendar div, but it still didn't work. The z-index of the overlay and the dialog is 1001 and 1002 respectively. $('#ui-datepicker-div').css('z-index', 1005); ...

ASP.NET navigate to anchor in code behind

I have a simple Web Form with code like this: //... //tons of text //... <a name="message" /> //... //tons of text //... <asp:Button ID="ButtonSend" runat="server" text="Send" onclick="ButtonSend_Click" /> After POST I want to navigate user to my anchor "message". I have following code...

javascript with jsp

Ok its a continuation of my crap attempts of using client side scripts along with server side elements. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <meta http-eq...

JSON / JSONP / DabbleDB

I'm trying experiment with DabbleDB to see if it's something that I could use to store data in. They have a JavaScript API that's based on JSON (http://dabbledb.com/help/guides/jsapi/). I've never used JSON before and have been trying to understand how to use it. The above link has their APIs file (which I downloaded and called "json-a...

JavaScript: DOM load events, execution sequence, and $(document).ready()

I just realized that I lack the fundamental knowledge of what exactly happens as a page is being loaded into a browser. Assume I have a structure like this: <head> <script src="jquery.js" type="text/javascript"></script> <script src="first.js" type="text/javascript"></script> </head> <body> ... <script type="text/javascript" id="midd...

Auto post back on page load

I need to autopostback my page on the first load, and i need to wait the entire page have finish loading before post back the page. I use in the page load if (!IsPageWasPostBack) { ScriptManager.RegisterStartupScript(Page, Page.GetType(), "forcePostBack", "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(post...

show a hidden div on reload after submit_form button click

I need to show a div upon page reload after the user clicks on the submit form button. Specifically, I have a PHP contact form in a show/hide div. Clicking on contact shows and hides the contact form. Both the show/hide js and the php contact form work perfectly. When the user clicks submit -- the page reloads and the "message sent" is...

How can I check for the correct location of commas in a number entered by a user?

I'm looking for a good way to check a number that a user has entered for correct position of an optional comma(s). For example 1,000,000.00 = correct 1000000 = correct 1,00,000.00 = incorrect ,100,000 = incorrect So it looks like i need to check to see that there is at least one number to the left and 3 numbers to the right of the com...