javascript

Load random CSS on page refresh

I was wondering whats the best way to call a random css file on page refresh with Javascript? Many thanks ...

jQuery .hover() only working in FireFox

I need to add informational popups to several menu items, and Im using jQuery .hover to do so. However this only works in Firefox and does not work in Safari, Chrome or Opera. var Main = function() { //other functions... function _setPopups() { $(".dt_event_title a").hover( function(){ $(".i...

Dynamically insert special character into document title

Hi, I am trying to update the document.title with Javascript. This works fine, but now I want to insert the ü character into the title, which gives me a question mark at the place where the ü is supposed to be. Here is my code (I omitted the rest of the title for clarity): document.title = '\u2019 - \u252'; The strange thing is that...

jQuery FancyBox/Lightbox problem

Hi all, i write some html with JS into a div. like this $("#picdiv").html("<a rel='lightbox' href='pic.jpg'><img src='htumb.jpg'></a>"); it is just an example. So, i have in $(document).ready Funcktion this code. $('a[rel=lightbox]').fancybox(); but if i click on the link, a get to the page with picture... i know the Problem m...

jquery/js: OnFocus OnBlur ?

Hey, i wish to make an ajax call if it has lost the focus from my site for 1 minute, so when it's onfocus again it send an ajax call? How can i do that? ...

How are web developers accommodating former onmouseover or tooltip functionality in touch interfaces?

Possible Duplicates: Tooltips in the era of touch UX Design for Disabled Controls w/ the Touch Interface I've long been in debt to the wonderful wz_tooltip javascript library, binding mouseover events to tooltips in order to offer contextual information. However with touch interfaces on the rise, I am now looking for a bett...

How to use setInterval and clearInterval for infinite gallery

I am trying to fetch pictures for a gallery using JavaScript, but I experience problems. $(document).ready(function() { var currentPage = 1; var totalPics = 2; var picPerPage = 1; intervalID = window.setInterval(function() { console.log(currentPage*picPerPage); if (totalPics > (currentPage*picPerPage...

How to use __doPostBack()

I'm trying to create an asyncrhonous postback in asp.net using __doPostBack(), but I have no idea how to do it. I want to use vanilla javascript. Something simple like a button click can cause the __doPostBack() event to fire. I'm just trying to learn how the mechanism works. ...

Should I learn ASP.NET AJAX, jQuery or both?

I'm .NET developer. Most of my career I worked on web based intranet applications (ASP.NET WebForms) but always as a server side developer. Client side development was done by my colleagues more skilled in JavaScript and different JS frameworks. At the moment I have some JavaScript skills and very elementary understanding of both ASP.NET...

Only one ajax call, wait until success until next click

How do prevent like if a user clicks alot of times on a link that runs a ajax call, that it only run again after the it has been succeed ...

Google Analytics from a file:// url

We have an ajaxy sort of html based app framework thing and want google analytics to work with it. And I believe we have set things up properly to manually call _trackPageview where needed. However things don't seem to be getting reported. Now either I don't have it working right, or GA tracking from javascript with a file:// protocol...

Adding click events to user control

Hello All, I have a user control in an asp.net web application. The control outputs an html list that is customized based on the currently logged in user. The list items are generated from a database look up and the user control is formatted to appear as a drop down list in the page. The control itself is simple and looks like this: ...

Dynamically added video object to page, how to get plugin player to recognize it?

I've used javascript to dynamically add an object element of type video/mpeg to a web page, but the plugin that is to play the video doesn't handle the new object. Other possibly relevant details: The web browser in use is Opera for Linux Devices, I can connect to Opera Dragonfly and see the new object being added to the DOM as a new ch...

CSS3 Javascript Library

Hi! Does a Javascript library exist that enables the usage of CSS3 properties such as rounded corners in unsupporting browsers? Thanks, DLiKS ...

Javascript function that works like actionscript's normalize(1).

I need a formula that returns normalize numbers for xy point - similar to actionscript's normalize() function. var normal = {x:pt1.x-pt2.x,y:pt1.y-pt2.y}; normal = Normalize(1) // this I do not know how to implement in Javascript ...

checkbox image replacement,nothing happend

<?php //require 'includes/db.inc.php'; require 'includes/configs.inc.php'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <title><?php $site_name ?></title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script t...

Upload canvas element to webserver/database?

Hi, I'm searching for a good method to upload a canvas element from Firefox to a webserver or database to have the ability to reload it later. My ideas: 1. my first idea was to use getImageData() and save the canvas as an ImageData object to the database, but this might not a good solution because these objets can get quite large. 2. s...

How can I discover what JavaScript function is called when clicking on something on a page?

I'm trying to deconstruct part of Gmail and can't seem to be able to find what is happening (what functions are called) when a specific button is clicked. I used Google Chrome's inspector and found the HTML for the button: <tbody id=":8y" class="vC " idlink="" role="option" aria-labelledby=":8x :8w"><tr class="vI"><td><img class="vt SF...

Getting a reference to the parent IFRAME

Say I have a reference to a document object, which is contained inside an IFRAME. How do I get a reference to the container IFRAME? .parentNode and .ownerDocument both return null. Please note that no context information is available (e.g. solutions like 'window.xxx' will not work) - all that's available is a reference to the document ...

Javascript Canvas drawing problem

So I have a bunch of javascript to make some random points, and then connects them via a minimum spanning tree. That all works fine. Then after that it draws the points and paths onto the canvas; and it draws an image like this: - Randomly generated each time. The problem I have with this, is that I'd like to have each of the circle...