javascript

IE 6/7 Access Denied trying to access a popup window.document

I'm creating a popup window with no URL source using window.open(). I don't give it a URL because soon I'll want to post a form to it. However, in the meantime I'd like to display a short "Now loading..." message so the user isn't looking at a blank page for the 2-3 seconds it'll take the form post to go through. I tried adding Javasc...

Call Javascript onchange event by programatically changing textbox value

the problem I'm facing is this: I have a textbox for a date range along side a calendar control. When the user selects a date from the calendar, it fills that date into the textbox When this happens I want to fire a javascript function, however, the 'onchange' event doesn't seem to happen. I'd ideally like to be able to add the eve...

JQuery Autocomplete CSS not working?

I am trying to implement JQuery Autocomplete pluggi using Django. I've been able to wire the thing together and I can actually see the result back in the HTML template. My problem is that the JQuery Autocomplete CSS doesn't seem to work. The results I get are not well formatted/styled, and they have no background and you cannot even sele...

Self-closing popups in IE -- how to get proper onBlur behavior?

I want a transient window to close itself when the user clicks away from it. This works for Firefox: var w = window.open(...); dojo.connect(w, "onblur", w, "close"); but it doesn't seem to work in Internet Explorer. Some other sites made reference to an IE-specific "onfocusout" event, but I couldn't find a coherent working example of ...

jQuery UI sortable, each sortable div contains an iFrame gets refreshed in FF3 but not in IE7

I'm using the jQuery UI Sortable on DIV which contains DIV tags. Inside of each of the sortable DIV's is an iFrame with a src= to a different site. In IE7, sorting works as expected. If you've navigated within the iFrame, the iFrame retains the current state. However, in FF3, when sorting stops and the iFrame is reloaded with the ori...

Javascript Firefox problem

Hi, I am trying to execute the following code from a firefox extension but it is not working. The actual code inside the else part was different but even this simple for loop is not getting executed. alert box without the for loop is working. Can someone have any idea about why this is not working. Thanks window.addEventListener("pages...

Designing code for a duo Website + AIR desktop App

I want to use AIR to create an OFFLINE version of a "webapp" kind of website (lots of ajax, front end code). Haven't been much further than the HelloWorld example, I keep wondering: how do you design your code, to maximize code reuse between the website (say in php or Java or .Net), and the AIR app ? Can you actually re-use 100% of th...

Putting JavaScript at the end of the page produces an error

I recently read that for a faster web page load it's a good practice to put the JavaScript links at the end. I did, but now the functions of the referenced file doesn't work. If I put the link at the beginning of the page, everything is fine. Does this thing of putting JavaScript at the end work only under certain circumstances? ...

How to return a value from a pop up window

I am using asp.net webforms 2.0, c#. What I need is a simple, elegant way to do the following: User clicks an element in webform A; Webform B pops up; User interracts with webform B; On closing webform B, probably by a submit button, the source element in webform a a is updated with a value from webform B. What technologies would be i...

How to detect right mouse click while left mouse button is pressed in IE?

I have the following: <html> <body oncontextmenu="return false;"> <script src="jquery-1.3.2.min.js"></script> <script> $(document).ready(function() { $(document).mousedown(function(e) { if (e.button == 2) //right click { document.body.style.backgroundColor = "green"; } else //left clic...

How to highlight only the text on hover, not whitespace? (javascript)

I am using jquery to highlight on hover, but it highlights entire div instead of just text. I tried using an "a tag" but do not want a reference link obviously. im sure this is simple, but im wasting too much time on trial and error. tia ...

How do I parse a URL into hostname and path in javascript?

I would like to take a string var a = "http://example.com/aa/bb/" and process it into an object such that a.hostname == "example.com" and a.pathname == "/aa/bb" ...

How do i add new attribute (element) to JSON object using javascript

How do i add new attribute (element) to JSON object using javascript ...

Read multiple variables from data object returned with ajax

I am making a jquery ajax call to an mvc controller. I want to return 2 or more variables from the controller. How do I package data in controller for this ? how do I extract with jquery? ...

How do I disable right click on my web page .

Hi All, Can I disable right click on my web page without using javascript because most of the browser allow the user to disable javascript. ...

How to get textbox value from client side and create query string from it?

I'm using jquery for modal dialogs. I want to open model dialog from one page and to send some additional query string to modal dialog page. something like this: <asp:HyperLink ID="hypClientSearch" runat="server" NavigateUrl="~/SomePage.aspx?KeepThis=true&additionalQS='<%= txtBox.Text %>'&TB_iframe=true&height=650&width=800&modal=true"...

jQuery fade all other images

Hi, I made this code with jQuery to fade images (but not the one a move the mouse over) and all images fade at the same time! $(".playThumb").fadeTo("normal", 1); $(".playThumb").hover(function() { $(".playThumb").each(function() { if ( $(this) != $(this) ) { $(this).fadeTo("fast", 0.3); } }); }, function() { $(".playThumb")....

JavaScript: Is it better to use innerHTML or (lots of) createElement calls to add a complex div structure?

I'm looking at a problem that needs a complex block of divs to be created once for each element in a set of ~100 elements. Each individual element is identical except for the content, and they look (in HTML) something like this: <div class="class0 class1 class3"> <div class="spacer"></div> <div id="content">content</div> <div class="sp...

What does formatResult and formatItem options do in JQuery Autocomplete?

Am a bit confused here, what does the formatResult and formatItem do in the JQuery Autocomplete plugin? I have a function that is returning a comma separated string (from Django), but my autocomplete function is unable to split the string into individual entries/rows, how can i achieve this using autocomplete functions? e.g the return...

Overwriten "this" variable problem or how to call a member function?

I have this class where I am using a combination of jQuery and prototype: var MyClass = Class.create({ initElements: function(sumEl) { this.sumEl = sumEl; sumEl.keyup(this.updateSumHandler); }, updateSumHandler: function(event) { // Throws error here: "this.updateSum is not a function" this.updateSum(); }, updateSum: funct...