javascript

Check Ctrl / Shift / Alt keys on 'click' event

How could I identify which Ctrl / Shift / Alt keys are pressed in the following code ? $("#my_id").click(function() { if (<left control key is pressed>) { alert("Left Ctrl"); } if (<right shift and left alt keys are pressed>) { alert("Right Shift + Left Alt"); } }); I work with Firefox 3.6.3. Thanks ! ...

Dojo How to ColorPalette + TooltipDialog + DropDownButton

I am trying to add a ColorPalette into a TooltipDialog, which in turn is contained inside DropDownButton (dojo 1.3.1) Code: var paramsContent = new dijit.layout.ContentPane(); var colorPalette = new dijit.ColorPalette(); var tooltipThematic = new dijit.TooltipDialog({content: paramsContent}); var colorField = new dijit.form.DropDownBu...

Regarding the scrollbar in the cascade menu

Hi All, I have to solve a defect. The defect is there is a scroll bar attached to the vertical cascading menu. When I try to scroll through the items using the scrollbar , the menu disappears. That is, When i place the mouse over the scrollbar the menu disappears. But when i scroll the items through the mouse, the scrollbar is also mov...

how to hook up default beforeunload event on an aspx page ?

I have a custom web part placed on one of the application page in SharePoint. This page it seems already have a function which gets executed on windows beforeunload javascript event. My problem is that i too need to execute some client side code (to prompt user for any unsaved changes in my web part) on windows beforeunload event. Ho...

Want to set 'src' of script to my IP-Won't load in Safari or Chrome. Relative link asp.netmvc

I have a script that links to the server I am hosting (IP can change) usually I would just use for links: var url ='http://' + window.location.hostname + 'end of url'; But in this case it isnt appearing to be so easy. I have tried: (1) $('#scriptid').attr('src', url); as well as: (2) var script = document.createElement( 'script'...

Rendering javascript at the server side level. A good or bad idea?

Now a community wiki! I want to make it clear first: This isn't a question in relation to server-side Javascript or running Javascript server side. This is a question regarding rendering of Javascript code (which will be executed on the client-side) from server-side code. Having said that, take a look at below ASP.net code for example:...

What is wrong in this JSON string?

My JSON string looks like this, [{"id" : "38","heading" : "Can you also figure out how to get me back the 10 hours I sp.....","description" : "Im having a very similar problem with the Login control - again it always generates a default style containing border-collapse - only in this case .....","img_url" : "~/Event...

Small help in alert box by moo tools

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.2/mootools-yui-compressed.js"&gt;&lt;/script&gt; <script type="text/javascript" src="sexyalertbox.v1.2.moo.js"></script> <link rel="stylesheet" type="text/css" media="all" href="sexyalertbox.css"/> <body> <p><a href="#" onclick="Sexy.aler...

Small questions for AJAX onreadystatechange

xmlhttp.onreadystatechange=function() { So this says onreadystatechange, invoke function(). Can I put parameters in function()? Second question, what does it mean when someone writes, xmlhttp.onreadystatechange=statechanged? Does that mean it will always be true or something? ...

new page/forward in javascript

I am making a greasemonkey script and i would like a link to go forward and modify the current html and allow the user to click back to go to the original page. How might i do this? using jquery + greasemonkey + javascript. Targeting firefox mostly. -edit- http://jsfiddle.net/ seems to do it. If you write random html in the html sectio...

Page zoom slows down page rendering

I'm building a map viewer much like Google maps and i've run into an interesting performance problem when a page is zoomed (i.e ctrl + OR ctrl -). It seems to affect all major browsers but Firefox has the worst problems as far as I can tell. The problem is that when the page is zoomed panning by dragging the mouse seems really sluggish....

Referencing global variables in local scopes

Hello, I would like to know memory leak in the below mentioned code. Does JavaScript do automatic garbage collection. var aGlobalObject = SomeGlobalObject; function myFunction() { var localVar = aGlobalObject; } Do I have to clear the memory as given below. var aGlobalObject = SomeGlobalObject; function myFunction() { var lo...

How to create many div's with 100% height?

I need a html document, that contains multiple div's with 100% height (screen filling) one below the other. I have tried to apply every element a height of 100%, but that won't work seamless nor clean. Maybe there is a option with JavaScript? I don't have an idea. Please suggest me your solutions. chris ...

Passing JSP parameter to javascript won't work in IE8!

I've got a Servlet that generates a XML string (relatively long) which I then pass to a Javascript variable in the forwarded JSP file: $(document).ready(function() { ... var itXML = <% out.print((String) request.getAttribute("xml")); %>; ... } This seems to work just fine in Firefox, but when I run the same project on IE8 ...

How to remove text on Marker using Fluster2 library ?

Hi, How to remove the text on a marker using Fluster2 Library ? ...

Way to see which elements are still loading and are hindering window.onload from firing?

Hi, is there a way to see which elements of a website are still loading so that window.onload can't fire yet? ...

How to decode JSON (varying number of elements, varying keys) using Jquery

My JSON looks like this: { "[email protected]":"Person1", "[email protected]":"Person65", "[email protected]":"Person24" } It's returned in various number of elements, and various keys. How do I traverse the data if my code is like this: $.post("includes/ajax.php", { group_id : $('#group').val() }, function(data) { //how d...

how can a firefox extension detect content-type of the page loaded ?

since my extension's pageload is triggered even when I view css or js files, i want to add another check that triggers my extension only when the current page's content-type is text/html . //eg: at my page load handler function onPageload(){ // only want to proceed if content-type reflects a text/html or */html page if ( contentTyp...

What if Web page's background matters

Hi, I have a complex background image and images, that should be on exact positions of the background image. How can I organize web page? I can't use absolute positions, because I need to organize background to view it nice on any monitor, any resolution and any browser. It can be aligned to center or smth else. Web page can be writ...

Dual or triple (or even multiple) comparison in JavaScript

Almighty Gurus, Please tell me, I want to know can comparison sm. set of variables in row, like this: x < y >= z or i need to do it in two steps? (x < y) && (y >= z) ...