javascript

How to close GreyBox on pressing escape or if a user clicks somewhere else on the page?

I am using GreyBox for opening a new HTML page in the same window. It's working fine but now I want that it should get closed on pressing escape or if a user clicks somewhere else on the page. How can I do that? edit:--- document.onkeypress = function (event) { if (event == undefined) { event = window.event; } if (event.keyCode == 27...

Resize event not handled

I have a simple webpage that IIS is hosting. This page is being called via a window.openModalDialog() command. I am using IE8. The div/body are set to fill the browser window. This works everytime except the first time this page is loaded. The first time this page is loaded, the body does not fill the size of the browser window. For so...

Facebook 'Like' buttons and # URL strings?

What does Facebook make of 'Like' buttons in a ajax web app if they are referring to the same page but with a different # string? Does it treat them as different pages to 'like'? for example if i get 4 like clicks: mysite.com/articles#story1 mysite.com/articles#story2 mysite.com/articles#story3 mysite.com/articles#story4 what will...

How do I know if a server has JSONP turned on?

How do I know if a server has JSONP turned on? It is not my server, but I try to access some information from the rendered html. Thanks in advance. ...

Cloning a field with text in it clones text as well?

Hi guys, I have a piece of code that clones three fields, but when it clones the three fields, it also clones the text entered inside of it, is there a way to clear the content inside of the field when it is cloned? $(document).ready(function() { $('#btnAdd').click(function() { var num = $('.clonedSection').length; ...

need a regular expresion to validate started double quote is ended or not

Need a regular expression to validate a double quote(") is started and it must to be ended. Example : "This is valid" but "This is not valid ...

jquery help needed

hi all, I am using autocomplete plugin in my form. I am using this autocomplete feature for a textbox inside a div, which is generated by AJAX, anyway autocomplete feature is working properly...I need your advice after selecting a an autopopulated data from textfield, I need to run a javascript function to take the selected data to fill ...

Cloning a field without cloning the text as well

Hi guys, I have a piece of code that clones three fields, but when it clones the three fields, it also clones the text entered inside of it, is there a way to clear the content inside of the field when it is cloned? $(document).ready(function() { $('#btnAdd').click(function() { var num = $('.clonedSection').length; ...

How to show <Select > in sorted order

How can I sort the <option> elements of a <select> tag using JavaScript? Here is the HTML I have: <form action="example.asp"> <div> <select size="3"> <option value="op2" >Option 2</option> <option value="op1">Option 1</option> <option value="op4">Option 4</option> <option value="op3">Option 3</option> </select> </div> </form> ...

Open Source Online IDE

Are there any Open Source online IDE's except for Bespin? If found some online IDE's like; phpanywhere.net, coderun.com, squadedit.com, codepad.org, but non of them are open source. Bespin isn't working for me, it could be because I'm a Opera user, but even in Firefox I couldn't get it to work properly. And if there is no other alterna...

Document.open won't work in windows vista IE8 as it runs in protected mode. What is the best alternative?

This is the Code I am using: document.open() returns null when we pass view from a jquery ajax call ("replace" ) var currentDoc = document.open("text/html", "replace"); currentDoc.write(result); currentDoc.close(); please share the best alternative.. Update: $.ajax({ url: '../controller/action/', type: 'POST', ...

google map problem -> google.maps.KmlLayer

Hi, I have a controller (address /Home/Test see below) which definately responds to get request with this: <?xml version="1.0" encoding="utf-8"?><kml xmlns="http://www.opengis.net/kml/2.2"&gt;&lt;Placemark&gt;&lt;name&gt;Simple placemark</name><description>Attached to the ground. Intelligently places itself at the height of ...

JQuery cleaning up eventhandlers

I'm an actionscript developer getting into jquery/javascript development. I have a question regarding event handlers and binding/unbinding. Say for instance that I have for an div with a img element with an onerror event handler in it. If i replace that that div with a new one do i need to remove the eventhandler bound to the img elemen...

Is this a valid email address?

"Françoise Lefèvre"@example.com I'm reading RFC 5321 to try to actually understand what constitutes a valid email address -- and I'm probably making this a lot more difficult than it needs to be -- but this has been bugging me. i.e., within a quoted string, any ASCII graphic or space is permitted ...

What is this thing I see in Internet Explorer jQuery1281617118201="24" , jQuery1281617118201="26" on some of my markup ?

Title says it all .. Thanks :) ...

Find %LocalAppData% path and add new folder with JavaScript

I created a Windows 7 Gadget and I need to create a place on each user's computer to store the Settings.ini file (Created from my SettingsManager.js file). The application packaging team at my company recommends I use %LOCALAPPDATA%\Microsoft\Windows Sidebar\ and then add Gadgets\iMon.Gadget\ subfolders. This is so each user's setti...

jQuery smooth mouse tracking

I have my object tracking the mouse using the onmousemove event. But I would like to make it smooth. I'm sure this can't be difficult in jQuery but I'm not finding any really good resources. One idea I had was to simply use the animate function and calculating the offsets that I want to move to. Then if the mouse moves again before the ...

Custom events and who's the sender?

I'm using a component writen in javascript. The component is exposing some events. The problem is I can't figure out who is the sender. They don't provide an instance of the sender as a parameter (like jQuery does). My question is: Is there any way to hook up the event using javascipt/jquery or any other way to get the sender? All I...

html canvas shape blur filter

There must be a way to do this. I have drawn a shape with the html5 canvas and I would like to blur it. As far as I know there is no native method so I assume a js library is needed. The problem is most libraries only blur images like this one for example. Is this possible? ...

Why it not work in document.onload?

<script> window.onload= function(){ var a = document.getElementById('a'); var b = document.getElementById('ct'); setInterval('b.innerHTML = a.duration',1000); }; </script> //Second script <script> var a = document.getElementById('a'); var b = document.getElementById('ct'); window.onload= function(){ setInterval('b.innerHTML = a.duration...