javascript

Rails Gem: calendar_date_select doesn't have a popup

I'm trying to get the calendar_date_select gem working. I've added <%= calendar_date_select_includes 'blue' %> to my layout, and the actual helper call I'm trying as a test is <%= calendar_date_select_tag "e_date" %> (from the demo page) The problem is that when I click on the calendar icon, nothing happens, and Chrome's element inspect...

At IE7, action "javascript:history.back()" in JSP jump back to main page, not previous viewed page.

Below are the code pieces in one jsp page, the function is to jump back to previous page, it works on Firefox 3.5, but does not work on IE7, at IE7, it will jump back to main index page. how to enhance it to support IE7/Firefox at the same time? <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO...

Get the end of string with Javascript

Hi, I am storing a string (url) in a variable it can look like one/two/three/test.aspx?ID=12312 I want to extract the querystring value, not from window.location but from the html I thought I could use substring and write var link = ($(this).find('a').attr('href')); var qs = link.substring( link.indexOf("="), text.indexOf(" ") ) ...

How to detect browser using javascript in facebook

I m tring to detect browser using javascript in my facebook application. I m using following code: if(navigator.appName == "Microsoft Internet Explorer") { //do somthig } but this code is not working. Please help me. ...

How to resolve this eror - there is no attribute "onFocus"

Hello.. I am getting an error called there is no attribute "onFocus". I have a code as follows: <input name="name" id="name" class="small required name" type="text" value="Name:" onFocus="if(this.value='Name:'){this.value=''}" /> I tried validating my site in http://validator.w3.org/, and I got these errors. Can anyone help me to resol...

Increase iframe height according to the iframe content. most content is loaded via ajax inside the iframe?

Major problem : increasing height after ajax content is loaded. ...

How to disable auto update when jqGrid edited?

I'm trying to use form editing on jqgrid. When the data is changed, data is sent to the web server an automatically. I don't won't to send edited data to server. Just edit data on html tag value? Any idea? Can you guys put some working example? Thank you for every advise? ...

Extracting text from a contentEditable div

I have a div set to contentEditable and styled with "white-space:pre" so it keeps things like linebreaks. In Safari, FF and IE, the div pretty much looks and works the same. All is well. What I want to do is extract the text from this div, but in such a way that will not lose the formatting -- specifically, the line breaks. We are using...

How to get the value of content that gets hidden or autogenerated?

This question comes after solving my last question, I'd like to get some values out of the hidden forms but when I try to retrieve them only empty strings come by, I've considered just using arrays to store the information as it is introduced but I'd like to know if it's possible just to retrieve it afterwards and how. Also, There is a ...

Will jQuery fail with client side XSLT

I am looking to offload some processing to the client via client side XSLT. If I do this will my current JavaScript and jQuery still work? ...

get parent frame height with jQuery

I want to get the height of parent frame with jQuery. It's my orginal script var iframeElement = parent.document.getElementById('FrmPatient'); iframeElement.style.height = 170; I want to change this script to jQuery style. How to get that? ...

GUI Design breaks when resizing the window

When I resize my web page window, it breaks the GUI design and tabs looks bad: <TABLE border="0" bordercolor="red" cellpadding="0" cellspacing="0" width="100%" id="homeContainer" > ---------------- here the rest of contents </TABLE> ...

How to check image is loaded completely or not using JavaScript in Facebook

Hi! I m trying to execute some code when image is not loaded. I m using following code: <script language="javascript"> object = new Image(); object.src = '$imageurl'; if(!object.complete) { //do something } </script> But this is not working in Facebook. Please help me. ...

URL rewrite - Automatically - not manual

I have written a rule for redirecting in .htaccess file its redirecting for some pages , if we give that link manually.. but what i want is ,it should redirect automatically.... My requirement is : Instead of this link, links.php?page=1&ipp=All&exchange=adddata It should be redirected automatically http://example.com/folder1/links/...

Order of execution of jquery event handlers in respect to (inline) javascript event handlers

Correct me if I am wrong, but seems to me jQuery event handling is completely separate from the javascript event handling. I know that the order of executing jQuery and javascript event handlers themselves is undefined, but can the assumption be made that all javascript handlers will execute before jQuery ones? In the example given in a...

GWT: How to return (and handle) an error from multipart form (file) upload

Hello I have and Google Web Toolkit (Multipart) Form which post a file to my servlet. When error condition is happening in servlet I return an error. When everything is OK I return an JSON string. ... response.setContentType("text/html"); response.setCharacterEncoding("UTF8"); response.getWriter().write(out.toString());...

change text fields from JavaScript

Hi I have a small web page on my embedded device with such code: <th width="310" DHCP Relay:&nbsp;&nbsp; </th> <td>&nbsp;&nbsp;</td> <td> <% nvram_get("rg_dhcp_relay_enable""); %> </td> where 'nvram_get' returns either 1 or 0.I have two questions in this connection: (1) I'd like to print "ON" or "OFF" instead of 1 or 0 respectively....

Abort all JQuery AJAX requests globally

Is there a way to abort all AJAX requests globally without a handle on the request object? The reason I ask is that we have quite a complex application where we are running a number of different AJAX requests in the background by using setTimeOut(). If the user clicks a certain button we need to halt all ongoing requests. ...

window.attachEvent doesn't work in IE

Hello! I want to display picture in a new window. For that I wrote javascript function that opens new window. I open window with some fixed size (for example 500 x 500). But I want to resize my window to picture size. For that I attach event to this newly created window. Here is only code for IE because in FF and Chrome all works. var ...

Suppressing javascript lint error.

Hi, I'm developing a Firefox extension and I'd like to use Javascript Lint to help me find bugs. However, I keep on getting a "SyntaxError: missing name after . operator" error for the second line: const Cu = Components.utils; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Apparently it's because "import" is a keyword. But it's ...