javascript

Is it possible to determine if Adobe AIR app is running from browser?

Is it possible to determine if Adobe AIR app is running from browser? So I want to check if app is on, how to do such thing? ...

Capturing Ctrl-Alt-Del in JavaScript/jQuery

While just playing with jQuery/JavaScript I ran across this problem. I could capture Alt and Ctrl keys but NOT Del and certainly not all of them together. $(document).ready(function() { $("#target").keydown(function(event) { if (event.ctrlKey && event.altKey && event.keyCode == '46') { alter("Ctrl-Alt-Del combina...

Trigger jQuery Qtip on FullCalendar dayClick

Hello, I have a jquery fullcalendar. I would like to trigger jquery QTip (or other jquery solution (such as a lightbox)) when I click on a day to bring up a list of options. This question is similar to this question already posted, however different enough to warrant a new question. There is an event callback for this but I am unsure h...

javascript turn single line break to double line break

Hm... I'm trying to convert single line break into double line break, as in This is a sentence. This is another sentence. into This is a sentence. This is another sentence. Apparently this doesn't work ThisContent = ThisContent.replace(/(\n)/gm, "\n\n"); since it replace everything, including double line breaks. What'...

How to give CSS3 support to IE?

I use IE7.js but it doesn't have CSS3 support. I use jQuery always in my projects. What is the best lightweight way to give all CSS3 selectors and properties support to IE 6,7,8? I'm not asking for HTML5 support only asking to give CSS3 support in as much as light on performance way. ...

Executing javascript code stored in an element attribute using jQuery

say there is an element #button with the attribute onmousedown containing some random javascript how could I trigger the js in that element attribute using jQuery? j("#otherbutton").click(function(){ var script = j("#button").attr("onmousedown"); //what now? }); ...

iPhone Javascript execution time

Hi guys, In the Apple docs it says that JavaScript execution time is limited to 10 seconds for each top-level entry point. If your script executes for more than 10 seconds, Safari on iPhone OS stops executing the script at a random place I plan to have some Javascript run every 10 seconds or so that will do an AJAX query to the...

Restricting input to textbox: allowing only numbers and decimal point

How can I restrict input to a text-box so that it accepts only numbers and the decimal point? ...

XMLHttpRequest inside an object: how to keep the reference to "this"

I make some Ajax calls from inside a javascript object.: myObject.prototye = { ajax: function() { this.foo = 1; var req = new XMLHttpRequest(); req.open('GET', url, true); req.onreadystatechange = function (aEvt) { if (req.readyState == 4) { if(req.status == 200) { alert(this.foo); // refe...

Converting HTML entities to Unicode character in JavaScript?

Sample Conversions & -> `&` > -> `>` Any small library function that can handle this? ...

open a link in a new tab in the same window

Hi I am making a firefox extension which needs to open a link in anew tab in the same window of firefox. How should i do this? This opens in a new window (replacing the old window): window.location = url; This opens in the same tab window.content.document.location = url Any idea on how to open the url in a new tab? ...

Stop users from pasting Word into Dojo Textfield

We have an rich client application running with dojo 1.2.x. Sometimes users are pasting comments from their word 2007 into an textfield.This is an repeating source for errors with displaying this comments inside an an dojox.grid. Is there any "javascript" way to stop users pasting from word? ...

407 Proxy Authentication Required

getting following exception while making call using XMLHttp object asynchronously in mozila firefox. can anybody help me to resolve this issue? 407 Proxy Authentication Required The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. Description of cause- actually i am trying to make as...

how to implement 'page break' in epub reader.

Any idea how to implement 'page break' in epub reader? .epub is nothing but HTML pages, and epub reader renders those html pages. but i wonder how some epub readers like Adobe Digital Edition implemented page break. There,when we jump to any page, you will not find half displayed line(i.e only upper part of the letters visible and lower...

ExtJS : handling browser exit event (click on cross-exit)

Hi everybody, First of all, thank you for reading my question. I would like to know if there is any way to handle the browser exit event. For example, I would like to send a query when the user click on the cross-exit or simply close his browser. Thanks a lot. $t0rM ...

Firefox extension: how to read a cookie name and value on the current page

My extension works on an application, which requires user login. Once the user has logged in, I need to read the cookies and use them in my XMLHttpRequests. So initially I need to check if the cookie is set, if not, I direct the user to the login page. Once logged in, I need to read the cookies and send it as part of my further requests...

JavaScript Multidimensional Arrays

This wasn't the question I was going to ask but I have unexpectedly run aground with JavaScript arrays. I come from a PHP background and after looking at a few websites I am none the wiser. I am trying to create a multi-dimensional array. var photos = new Array; var a = 0; $("#photos img").each(function(i) { photos[a]["url"] = this...

xpath - limit search to node not working?

What am I doing wrong here? I am trying to limit my xpath search to a specific row in my table but my query always returns the content of the span in the first row: var query = "//span[contains(@id, 'timer')]"; var root = document.getElementById('movements').rows[1]; document.evaluate(query, root, null, XPathResult.FIRST_ORDERED_NODE_TY...

Respect regular onsubmit handlers from jQuery.submit

I want a jQuery form submit handler to respect any previous submit handlers, including ones added with onsubmit. I'm trying to detect the previous handler's return value but can't seem to do it: <form><input type="submit" /></form> <script type="text/javascript"> $('form')[0].onsubmit = function() { return false; }; // called first $('...

Is there no Javascript LIKE statement?

I want to do this but dont know how to do it in JavaScript. if (Email == "*aol.com" || Email == "*hotmail*" || Email == "*gmail*" || Email == "*yahoo*") { alert("No Hotmail, Gmail, Yahoo or AOL emails are allowed!"); return false; } Any way around this? ...