javascript

Detect if window has scrollbar in IE using javascript (window.open)

When i call window.open, I can include a list of parameters. One of these paramaters is scrollbars, which can be set to yes or no. When I put javascript in the child window, the javascript needs to detect if scrollbars were set to yes or no when the window was opened. I want to know if the window has scrollbars enabled by default or not...

Send a variable along with mouse event to a function

Hi I am trying to detect a ctrl + click on a link and then to send a variable to a js function . I have stripped the code down so I can show it as an example below. I find I can detect the ctrl+click event no problem . <script language="JavaScript"> function mouseDown(e) { var ctrlPressed=0; var evt = navigator.appName=="Netsc...

New with JSDoc. Best way to document an event handler in JSDoc ?

Hello Suppose I have a class like this: function myClass(q) { this.someFunction = function(e) { console.log("Click event"); }; jQuery(q).click(this.someFunction); } Is there a way to indicate to JSDoc that someFunction is not just a function that should be invoked directly but rather is an event handler ? I see the @even...

Jquery - how do I find the current cursor position

I have five forms in the page. I have my validation also in place using jquery validation plugin. There is this odd little case where I want to cover - wherein the server returns no results (for any of the forms) and I need to display the same jquery validation. I was able to do that with : $("#form1").validate().element( ".myid" ); ...

Javascript JSON.stringify object containing arrays serialization problem

I javascript I have an object that looks similar to: var myObj = { prop1: 1, prop2: 2, prop3: ["a","b","c","d","e"], prop4: 4, prop5: ["f","g","h","i"] } It's an object containing a number of properties. Each property may or may not be an array. var serializedMyObj = JSON.stringify(myObj); serializedMyObj is (fou...

Why does jQuery.cssRule plugin have to add rules to all style-sheets ?

I tried to use $.cssRule() plugin and found that it makes it inconvenient to debug those rules in FireBug because each rule appears to be attached to every css file loaded on my page and consequently defined many times. Source code shows that it does that on purpose inside that for loop: for(var i = 0; i < document.styleSheets.length; i...

Where to put partial specific javascript in rails 2.x

Consider the following partial, it gets inserted into a page if someone clicks ajax "add comment" link. The question I have is: Is this the best place to include that javascript? I thought it was best to put it in the application.js, but because the partial gets added via ajax, the validate method called within $(document).ready block ...

What does `1..something` mean in JavaScript?

<script> 1..z </script> This gives no syntax or runtime error. Looks like number and variable name can be any other (123..qwerty). I'm wondering what does this statement mean? ...

HTML javascript select action

I got a selection list: <select> <option value="0" onclick="anders('1')">Anders</option> <option value="200" onclick="anders('');" selected="selected">&#8364; 200,-</option> <option value="300" onclick="anders('')">&#8364; 300,-</option> <option value="400" onclick="anders('')">&#8364; 400,-</option> <option value="500" onclick="anders(...

JQuery Problem: $ not defined (I am trying to implement equal div heights script)

I need a solution that will set the heights of two divs whose class = col to the height of the tallest one. I found a solution here that I have used to implement this: http://www.cssnewbie.com/example/equal-heights/ This is the code that I have placed on my site: <script language="javascript" type="text/javascript" href="jquery.js"></...

jQuery .fadeIn turns content invisible in IE

Hi, I'm having some difficulty getting IE to behave. I have created a web page containing various hidden divs. These act as sub pages, when a nav item is clicked they fade in/out in a very basic lightbox manner. It works in Firefox & Safari but in IE (8) it fades in to about 60% then vanishes completely, also knocking out the backgroun...

jquery, domain, get URL

How can I get the domain name with jquery ?? ...

how do i set my 'Connect URL'and 'Canvas Callback URL' in facebook.

...

Select link right after the one i just clicked.

also threw it up on jsbin: http://jsbin.com/ohazo/2 but the code on jsbin is the old code, so overlay_nextimg is overlay_content.click in the javascript on jsbin Jquery lightbox, grab next link from the one we just clicked, take it's href, fade out the current image, and load in the next img. Also, how would i go about keeping the over...

create a new option and inject into select box using mootools 1.2

Hi i have one AJAX function which return the list of countries. It works fine. My problem is that want to load that countries in on select box which is already in HTML and is empty means no option value in it. I want to know that how can i create a new option element and inject into the select box using moo tools 1.2 I have used be...

javascript to launch only ONE window for a Java applet with a given URL

I need a javascript solution to launch only one window, with a Java Applet in it, for a given URL. I found a solution posted here on Stack Overflow - here: http://stackoverflow.com/questions/528671/javascript-window-open-only-if-the-window-does-not-already-exist But it doesn't seem to work .. I get Error: launchApplication.winrefs is ...

Javascript Syntaxhighlighting lost when AJAX call is made.

I have a page on my website that I am making a call to using a jQuery ajax call. It loads in a div. But whenever I the page is loaded, it loses the snytax highlighting that it should be displaying. Ex: <html> <head> <!-- syntax highlighting script --> <script type="text/javascript" src="syntaxhighlighter.js"></script> </head> <body> <!...

how to create button with Image & caption together in javascript

Hi i want to create a button which has caption (ex Category) and the Image of it in the Button too. so we can say that button has both Caption + Image I hav to use javascript only ...

refresh parent window when closing child window

how to refresh the parent window while clickin the button (close button) in the child window child is popup window ...

How can I use JQuery so that when a user clicks on this, a sudden color appears?

<a href="/list" onclick="????"> <div> LOTS OF INFO HERE LOTS OF INFO HERE LOTS OF INFO HERE LOTS OF INFO HERE </div> </a> I have a div, which is inside a hyperlink. The whole div is clickable. When the user clicks on this big div, I would like the entire div to turn light blue, and then slowly fade into white. This will give t...