javascript

Use ruby methods in javascript without ajax

Hi everyone! Is it possible to call a ruby method inside javascript? One way of implementing it is via ajax calls, but is there a way I can embed that ruby function inside the js file and call it just like calling any other js function? ...

Any way to fix the position of image

I have an image on the left hand side and text on right side. Like two column layout. I want that when i scroll the text then the image should stay at center of page. I tried using position:fixed But then the problem, sometimes when i resize the IE window to small size then the image stay at same position and it comes out of the ma...

convert java applet code in to java script

Is any way to convert a java applet code to java script? ...

Detect page load completed event in Firefox

I'm writing a Firefox add-on that do something after the webpage is completely loaded.My current code is var target = this; const STATE_STOP = Components.interfaces.nsIWebProgressListener.STATE_STOP; const STATE_IS_WINDOW = Components.interfaces.nsIWebProgressListener.STATE_IS_WINDOW; const STATE_IS_DOCUMENT = Components.int...

How To Open Outlook Task window from client side with javascript

Not for IE users. I want to Open the task window of outlook when the user click a button in my web page. i mean without using the ActiveXObject("Outlook.Application"); and again, method that will work for all browsers especially FF or Chrome. and i need it to be from the client side, not server side. BTY: i assume the user is usi...

form not identifying the new input fields generated through a javascript

Hi, I am developing a site in php. i have some issues with my form i have to more than one software packages at a time. so i have used javascript to append file and a dropdown to my html. i have called ajs function to add the new input fields each time when i click a link. and its displaying correctly. but its not identifying in ...

Possible Ways to Communicate Between iFrame and Parent Page across domains

Please suggest possible techniques to trigger events in parent page from an iFrame. I tried out url Hashing and using window.postMessage techniques but without any success. ...

How to prevent onclick statements from being executed?

I want to use an event listener for preventing the onclick statement of a submit button, however, using event.preventDefault() doesn't work as intended. The code is like this: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <h...

Why the parent page get refreshed when I click the link to open thickbox-styled form?

Hi, all: I'm using Thickbox 3.1 to show signup form. The form content comes from jquery ajax post. The jquery lib is of version 1.4.2. I placed a "signup" link into a div area, which is a part of my other large pages, and the whole content of that div area is ajax+posted from my server. To make thickbox can work in my above arangem...

How to ignore user's time zone and force Date() use specific time zone

In an JS app, I receive timestamp (eq. 1270544790922) from server (Ajax). Basing on that timestamp I create Date object using: var _date = new Date(); _date.setTime(1270544790922); Now, _date decoded timestamp in current user locale time zone. I don't want that. I would like _date to convert this timestamp to current time in city of...

Split date in javascript

How to split the following date in javascript, var date='2002-01-01'; The result should be as 20020101 Thanks.. ...

How to make this toggle effect possible?

default condition After clicking on Sitemap link How to write HTML to get footer links after the sitemap tree upon clicking on Sitemap link? ...

Jquery Ajax Problem

Hi all; var v_name = null; $.ajax({ type: "GET", url: "Testpage.aspx", data: "name=test", dataType: "html", success: function(mydata) { $.data(document.body, 'v_name', mydata); } }); v_name = $.data(document.body, 'OutputGrid'); alert(v_name); first alert undefined before alert work why ? ...

Range for Complex Selection

Hi All, I want to highlight the user selected Text. I cant use the JQuery Based API for Highlight since I want user specific highlight. Here is how my code looks like. var range = window.getSelection().getRangeAt(0); var sel = window.getSelection(); range.setStart( sel.anchorNode, sel.anchorOffset ); range.setEnd(sel.focusNode,sel.fo...

changing text periodically in a span from an array with jquery

I have a span, eg: <p>Here is a sentence <span id="rotate">this</span> is what changes</p> and I'd like the contents of that span to change every few moments between a list of terms, so the contents might change to be: <span id="rotate">then</span> <span id="rotate">thus</span> and so on. I'd like the text to fade out and then the ...

How to count li which does not have ul ?

Hi I want to count LI which does not have the UL , for the first level only, but when I count this it shows size 4 instead of 2, its count the inner LI also. <div class="navigation-container"> <ul class="first-level"> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a> <ul> <li><a href="#">Link2...

Browser side code editor component

Hello, do you know any browser-side component, in HTML/Javascript, Flash, Applet or Silverlight, that would allow source code edition with syntax highlighting and auto-completion. CodeMirror has a good syntax highlighting support but does not seem to support auto-completion. If no such editor exists do you know any way to implement au...

Preventing alert to show two popups when button is clicked twice

Lets say we have a js function which shows a pop up on a button click. But if the button is clicked twice in a hurry it show two popups. Is there any way to prevent alert to show two pop ups when the button is clicked twice in a hurry? ...

Rebinding jQuery qtip tooltip on images in bxcarousel

I'm using bxcarousel to show a bunch of images. Each image has a tooltip, which I display using qtip. This works fine for the first round, but when the images come round a second time the tooltips don't show anymore (because bxcarousel removes an element that slides out and puts it back at the end) An example of the carousel can be fou...

View images via Lightbox (or similiar) from a hyperlink

Hi I would like to view a gallery of images via Lightbox (or something similiar). The only problem is I need to display the image set in the viewer from a hyperlink rather than displaying thumbnails of the image set. Does anyone know if this is possible; if so could you point me in the right direction. EDIT: I've edited this, to hope...