javascript

Issues with most basic e4x test

When I load a page containing e4x in FF 3.5, I get no inkling that e4x even exists in the browser's JS implementation. Notes below, but here's my HTML : <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>e4x test</title> ...

Setting cookie from a JavaScript file on another domain

I have a site on domainA.com. It includes file.js from domainB.com: <script type="text/javascript" src="http://www.domainB.com/file.js"&gt;&lt;/script&gt; In file.js, I want to be able to set a cookie for domainA.com. How would I do this? It must be possible since Google Analytics does it for their __utma, etc. cookies. ...

What does Firebug "XML cannot be the whole program" error message mean?

I just got this error message in Firebug. A google search reveals nothing but other mystified people! Does anyone have any idea what it means? It's being indicated on the last line of this 3-line script: <script> g_BuildServer = "/"; </script> ...

Invoke an alert on an href, then continue to a new page

I have a link to a page which invokes the 'Sexy Alert Box' script to pop a message asking if users agree to Terms and Conditions with options "I Agree" and "Cancel". I've got that much going but now I need for the "I Agree" option to send them to a new page. ("Cancel" returns the user the current page.) Something to do with document...

very strange javascript error.

so all these time i had no problem with this script. all of sudden today, it began to behave strangely. so i have a javascript page that loads inside iframe. this is injected into a page loaded via proxy. $(top.document).ready(), throws error saying Permission denied... i was surprised so, i decided to try load a different page. th...

using jQuery to get absolute or relative position position of a div

I'll try to explain what i'm trying to get. I've a div with position:fixed (at the bottom of a page) into that div, there is some other divs. What i want is to show another div (with absolute position) aligned to the right with those divs... in other words, i wan't to know the left position of the divs... ...

Scriptaculous vs JQuery for rich client side effects

Scriptaculous vs JQuery for rich client side effects. What would you use and why? ...

Disable grey border on anchor (<a>) elements on focus...

I am trying to make the ugly grey border that appears around anchor tags go away. The CSS property "outline:none;" works for Firefox, but how can I do it in IE. Preferably using CSS expressions or jquery. I'm not worried about accessibility BTW. Based on your suggestions I found these to be the best solutions... The jquery(for IE brows...

how to kill a application session when a browser window is closed ?

Hello Everyone, i have a problem. I am working on a chatting application. I want to kill the session if user closes the browser window without logging off. I used 'beforeunload' function but it also fires when a postback event is fired so it's not good for me. Please help if anyone have any idea about it. ...

Waiting for child window loading to complete

Is there an easy hook for detecting that a window opened by a script has finished loading? Basically, I want the equivalent of the onLoad() hook, but I can't set it directly -- assume that the child document is a given and I can't actually put any code of my own in it. For instance, say I have the following two files: parent.html: <ht...

PHP - Break out of a frame

Is there a way to break out of a frame using PHP? I have done it with JavaScript, but I would really prefer to use PHP instead. Thank you. ...

Javascript RTE with spellcheck

Can anyone point me in the direction of a good rich text editor (cost not an issue) that has an inbuilt spell check or can be configured to point to an internal spelling service. I cannot use widgets that harness external jsonp services (google api etc) due to the application residing on a restricted network. ...

assign javascript string without escaping

Hi I have a problem with a javascript string var foo = \"<a href="javascript(foo('a','b'))">test</a>\" This sentence gives me an error I could have escaped inner " but I am not allowed to change <a href="javascript(foo('a','b'))">test</a> this part Is there any way to handle this condition? Thanks, Sourabh ...

Hide exception details from DWR JS error handling?

Hi, I use DWR 3.0 JavaScript lib. In direct call to *.dwr URL you get exception info, e.g.: throw 'allowScriptTagRemoting is false.'; //#DWR-REPLY if (window.dwr) dwr.engine.remote.handleBatchException({ name:'java.lang.IllegalArgumentException', message:'Failed to find parameter: scriptSessionId' }); else if (window.parent.dwr) window...

SyntaxHighlighter.all() doesn't work on DOM level?

I'm loading content dynamically into a div using the jQuery load() function. In the callback I'm calling SyntaxHighlighter.all(), to pretty print the syntax of the pre block that just got loaded into the div. The problem is that the content is loaded OK, but the syntax doesn't get highlighted. However, when I hardcode the pre block in t...

Is robust javascript-only upload of file possible

Hi, I want a robust way to upload a file. That means that I want to be able to handle interruptions, error and pauses. So my question is: Is something like the following possible using javascript only on the client. If so I would like pointers to libraries, tutorials, books or implementations. If not I would like an explanation to why...

Popup Dialog Hide after 10sec

Hi, I am working on some website , i have used jQuery UI , for pop-up dialog . I want to close that after 10sec, I have used fadOut 10000 ms but its slowly fades. Here is the link View the source code and please help me in this. ...

Javascript Augmenting basic types (prototype inheritance) doubt

I just started reading on Douglas Crockford's "Javascript The Good parts" where he explains about Augmenting basic types. Function.prototype.addMethod=function(name,func) { this.prototype[name]=func; return this; }; The moment after doing this, the addMethod becomes available for all basic objects like String, Number etc. Th...

JS regex validation help

Hay guys, i need help with a REGEX. I have the got the value of an input box with this. fileext = filename.split(".").reverse()[0]; I need to make sure this is a jpg, gif or png. Else throw an error. Thanks ...

How can i display this alert box after checking if my array of checkbox is all not checked

Hi guys i am creating a validation for checking if the user has selected at least one stand by checking it, if no stands are selected then an alert box should display telling the user to select at least one stand. my javascript function is triggered onsubmit. my code is function checkstanddocument(){ ab = document.getElementById("...