Hi
Is it possible to retrieve variable set in onreadystatechange function from outside the function?
--edit--
Regarding execution of functions:
If its possible i would like to execute ajaxFunction() with one click
and then popup() with next click, or
somehow wait for ajax function to end and then call for alert box
In pseudocode:
...
Lets say I have a web app which has a page that may contain 4 script blocks - the script I write may be found in one of those blocks, but I do not know which one, that is handled by the controller.
I bind some onclick events to a button, but I find that they sometimes execute in an order I did not expect.
Is there a way to ensure ord...
How can I go through all external links in a div with javascript, adding (or appending) a class and alt-text?
I guess I need to fetch all objects inside the div element, then check if each object is a , and check if the href attributen starts with http(s):// (should then be an external link), then add content to the alt and class attrib...
When I attach functionality to an element do I need to call .widgetName('destroy') before removing it from the DOM or does jQuery handle this?
...
Using jQuery, what's the best way to find the next form element on the page, starting from an arbitrary element? When I say form element I mean <input>, <select>, <button> or <textarea>.
In the following examples, the element with the id "this" is the arbitrary starting point, and the element with the id "next" is the one I want to fin...
Hi,
I am currently working on a JS menu for a web app. It consists of two bars, the fixed main one and the submenu which is activated (display:block from display:none) by Javascript function. The selected options of the main menu as well as the submenu are also highlighted by adding a class="main_on" and class="sub_on" by onclick event...
I am working on modifying an existing spell check plugin for TinyMCE.
This is what is supposed to happen:
1. User hits "space" and the spell check runs.
2. If the word is spelled wrong the word gets wrapped with a span and gets a red underline
what I find happening is that when the user hits space bar the word does get spell checked ...
Does anyone know if it's possible to determine, using JavaScript, whether the user's browser allows checkboxes and radio buttons to be focused? In other words, whether you can tab to select them.
I can't just use browser detection to do this, because in at least one case (Safari), the user can turn the ability on and off.
Also in Safar...
I have a form that contains a bunch of checkboxes. Before submitting the form, I'd like to grab the values of the checkboxes and stick them into a text field, then submit that.
So I might have:
Red
Orange
X Yellow
Blue
X Green
And I'd like my textfield to end up with the content "Yellow, Green" .
This doesn't seem too co...
I have a little javascript function which is attached to an onClick event of a button. It appears to work perfectly in Firefox(3.0.4), but both Opera(9.62) and IE fails to execute any other JS from the same .js file, including what normally works. The following function is the culprit:
function deleteComment(id){
$.post("ajax/comment...
Thanks for reading this.
I am dynamically generating some data which includes a select drop-down with a text box next to it. If the user clicks the select, I am dynamically populating it (code below). I have a class on the select and I was hoping the following code would work. I tested it with an ID on the select and putting the ONE on ...
I am using jQuery to make an AJAX request to a remote endpoint. That endpoint will return a JSON object if there is a failure and that object will describe the failure. If the request is successful it will return HTML or XML.
I see how to define the expected request type in jQuery as part of the $.ajax() call. Is there a way to detec...
I'm currently using the Yahoo YUI javascript library in a couple of my projects.
However, I'm a little concerned about three things. First, they laid off 10% of their employees. Second, their stock price keeps falling: especially after ignoring the MS takeover earlier this year. Third, what if someone does buy them?
The only reaso...
I am currently looking at the "unload" event of a window to try to determine how the "unload" event was triggered, but am having little success. Is there a way to determine how the javascript event was triggered?
Page Refresh
Back Button (or navigate away from the page)
Closing the Browser
Essentially I need to execute some code only...
Hi all,
I embedded a swf in my html page, but I would like it to swap to another swf when I clicked on a button in html. I used swfobject.js to embed the swf, and I use prototype to write the javascript. I thought I can just do this
$('movie').value = 'swf/bhts.swf';
alert($('movie').value);
the value did change to swf/bhts.swf, but ...
Suppose I have a page that I am writing a javascript plugin for on the domain first.com. The javascript plugin injects an iframe pointing to a login page (of domain second.com) into the first.com page and displays it as a popup so that the user can login. Is there anyway for me to hide/close the iframe after the user logs in with it? ...
We have an advanced webpage (ASP.NET, C#), and a application which needs to be installed on the client computer in order to utilize the webpage to its fullest. The application is a tray app, and has primarily two tasks. Detect when certain events happen on the webserver (for instance invited to a meeting, or notify of an upcoming meeting...
I have got a button with an onclick javascript event that does some form validation. If the validation fails, false is returned. Otherwise nothing is returned, and the form should be submitted.
But what's happening is the url loads in the address bar but the page never loads. No headers are sent, no error messages display. Just a blank...
Hi,
I stumbled upon this javascript obfuscator called Squash, I want to use it on my ExtJS project to obfuscate my javascript files. I've tried it and the result are totally obfuscated codes. But it seems that I have to obfuscate the ExtJS library too because I got warnings that it couldn't find functions such as Ext.onReady(), Ext.form...
How can I delete all the tables in a web page? The tables don't have any ids associated with them.
...