javascript

mouse event weirdness

Here is the greasemonkey script I'm working on (source below): http://userscripts.org/scripts/show/69722 You can test it out on this page: http://forums.whirlpool.net.au/forum/35 Hover over a thread title and a div appears with a preview. The weird thing is, when you move your mouse around on the div, the 'mouseout' event is getting f...

Read a local text file using flash or javascript?

Hi, Is there any hook to react to a user drag and dropping a text file onto a browser? If the user drops a text file onto the browser with my page loaded, I'd like to be able to open the contents of the text file using javascript. I don't think this is possible, but just checking. Is something like this possible in flash? As an altern...

Navigation and the Case of the Missing Drop Down

I created a nice little menu with mouseovers and a drop down menu. The navigation code is simple: <ul class="menu" id="menu"> <li><a href="#" class="menulink" id="home">Home</a></li> <li><a href="#" class="menulink" id="about">About</a> <ul> <li><a href="#">Our History</a></li> ...

Shadowbox.js: black text on black background with welcome message on window load.

Hey, I am using the Shadowbox.js example code to show a shadowbox with the message "This site is still under construction!" on page load: <link rel="stylesheet" type="text/css" href="shadowbox.css"> <script type="text/javascript" src="shadowbox.js"></script> <script type="text/javascript"> Shadowbox.init({ // let's skip the automa...

[Ajax] Holding old image until new image is ready to update.

Hello, I am using setInterval and the jQuery load function to periodically update an image tag. var refresh_days = setInterval(function() { $('#box_name').load("dynamic.php");}, 1000 ); This works, but there is a slight delay before the new image is fully loaded, during which nothing is shown. Is there a way I can wait until th...

Tree of checkboxes

I'm looking for a "tree of checkboxes" widget for Javascript. I tried to use jquery-checktree which purports to do exactly what I want, however it has the following problems: It doesn't recognize checkboxes that are already checked and renders everything as unchecked. It starts off with everything collapsed and doesn't give an option ...

How can I ensure correct load of dynamic JavaScript files?

I have an app where generated HTML pages specify a single JavaScript file: <script language="JavaScript" src="/global.js"></script> In global.js is the following code, to load a single user-defined user.js file: var UserJsFile = document.createElement("script"); UserJsFile.type = "text/javascript"; UserJsFile.src = "/user.js"; docume...

Mixing server & client controls, event handling

This is a recurring question on many forums, and I have a working solution, but it is ugly. I need to disable buttons after a click to prevent double-submission of a form. I do this by changing the css class, which will disable and dim the image. Because the JavaScript consists of both litteral and generated parts, and I am mixing clien...

Is it worth the time to care about users who have Javascript disabled in their browsers?

Possible Duplicate: Is it worth it to code different functionality for users with javascript disabled? I've just learned in this question that an ASP.NET webforms application will have issues to run properly in a browser with disabled Javascript (unless I don't use certain controls and features). So this is a kind of a follow...

How do I continuously pass values from PHP to javascript

Hello, I need to update my UI (webpage) periodically with new values. I have PHP code that grabs the values form a database, but I am not 100% sure on what is the best way of getting that data to the UI side. The complication here is that: 1. I need to constantly update the values (every second) 2. I need to update many different areas...

When do I need to specify the JavaScript protocol?

I was under the impression that I only need to specify the "protocol" when using JavaScript in URL attributes, such as in hrefs. Is this the only "useful" context for javascript:? Sensible: <a href="javascript:alert('Hello')">World!</a> Silly: <form onsubmit="javascript:alert('oops!')"> Is this right? Or is there some obscure bug/...

Sys is undefined in an ajax enabled SharePoint

I have a SharePoint app that is configured correctly in the web.config for asp.net ajax, but when I try to use the Sys class it says it's undefined. I have installed SP2 and know that ajax is enabled because update panels work correctly. ScriptManager is being loaded to the page. I have a script link to register the external js file, and...

Copy Image to Clipboard from Browser in Javascript?

Is it possible to copy an image to the clipboard in javascript? I know how to copy text, but can you copy images? Is it a security limitation? ...

Yahoo Weather, Yahoo GeoPlant, Google Weather or another API to connect to with javascript?

I need a way to get the current weather back for a certain city with javascript? Which API would I be better to use? Or are there any other apps that you can use an ajax request to get the current weather? GeoPlanit required an appid so I haven't tried this yet and yahoo weather is an RSS feed. I have also read that Google's weather API...

UI performance monitoring tools

I am looking for a tool that lets you monitor/log page rendering time on client machines. I am not looking for firebug/yslow because i want to know the following type of things: How does fast do my pages load when the user is in russia? How long does it take for javascript to run on some pages for everyone who accesses those pages? S...

jQuery .css("margin-top", value) not updating in IE 8 (Standards mode)

I'm building an auto-follow div that is bound to the $(window).scroll() event. Here is my JavaScript. var alert_top = 0; var alert_margin_top = 0; $(function() { alert_top = $("#ActionBox").offset().top; alert_margin_top = parseInt($("#ActionBox").css("margin-top")); $(window).scroll(function () { var scroll_top = $(window)...

How do you make images load only when they are in the viewport?

I am seeing a lot of sites these days, mainly tutorial sites that have a lot of images and they only load images further down the page once they come into the view port? How would I go about doing this? An example: http://www.chopeh.com/blog/logo-design-start-to-finish/ As you scroll down the page the images below the view port fade ...

Javacript show/hid div and change a css class based on which div is visible?

Hi - I have little piece of javascript to show/hide divs based on which link is clicked in a list. Its not very eligant, but it works fine. What I'd like to do is to assign an active state the a list item depending on which div is showing. Here is my JS and HTML: var ids=new Array('section1','section2','section3','section4'); functi...

Intellisense - Javascript in a string

Hello, I have a long javascript in a string and programatically using RegisterClientScriptBlock, I add it to my page. Is there any way to have the intellisense detect my javascript inside the string? Code: string Script0 = @" function dummy() { } var PTRValues = new Array(); ... ... .. "; this.Page.ClientScript.RegisterClientScript...

JQuery vulnerability (NVD CVE-2007-2379)

We're using JQuery and I've come across the following JQuery vulnerability in the National Vulnerability Database: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2379 Has this been fixed in more recent versions of JQuery? The original release date on the vulnerability is 4/30/2007. I'm trying to ensure that the little JQuer...