javascript

remove CSS Link / update paths with jquery/javsscript? (Design time CSS)

Hi there, does anyone know if its possible to remove a css link at run time... Basically i have partial HTM files in a directory so hence if i add a css link (so i can use my design time editor) then this link isn't valid at runtime and i don't need it as my CSS is in another file. I just want to be able to strip it out when i load it ...

Send array from Flash (AS3) to JavaScript.

Is it possible to send an array from Flash (AS3) to JavaScript using an ExternalInterface call? I currently am calling a function multiple times from a 'for each' loop inside Flash but it goes too fast for the JavaScript to keep up. My idea is to create an array of the attributes, pass that to the JavaScript function and then to loop...

Are GWT wrappers on top of javascript libraries discouraged?

I'm in a process of selecting an API for building a GWT application. The answer to the following questions will help me choose among a set of libraries. Does a third-party code rewritten in GWT run faster than a code using a wrapped JavaScript library? Will code using a wrapped library have the same performance as a pure GWT code if th...

Drop updating a hiddenfield with an unrelated value

If you wanted to change the value of the hidden field to something not in the value of the dropdown like so <form> <select id="dropdown" name="dropdown" onchange="changeHiddenInput(this)"> <option value="foo">One - 42</option> <option value="bar">Two - 40</option> <option value="wig">Three - 38</option> <...

how to avoid listing previously entered values in certain text fields of a form? HTML, PHP

Hi In my HTML FORMs, when I focus certain text fields they list down history of values entered previously. Is it possible to avoid this auto-drop-down? I am not looking for some browser settings tips for my computer, instead, I want these settings for all of the users of my website filling a form. Will it also be possible to apply the...

How to replace a method without losing the original?

I'm replacing (overriding, improving, adding functionality to) a method in the prototype of the Date object. Here is a simplified version of what I've done: Date.prototype._toString = Date.prototype.toString; Date.prototype.toString = function(mask) { if(mask == undefined){return this._toString();} //snip //... //snip ...

How do I build an iframe with the same domain as the page in Safari/WebKit

The scene: I'm writing an embeddable widget. It takes the form of a <script> tag, which builds an iframe containing everything it needs to display. The iframe has no src, and the script writes to it with theIframe.contentWindow.document.write(). This keeps the widget contained, and keeps element ids and script from conflicting with th...

IE6/IE7 javascript console bookmarklet (not firebug lite)

What bookmarklet do you use to debug javascript / DOM on IE6? I am looking for something that has "last typed command" feature, object inspection, and perhaps DOM inspection as a bonus. I am looking for not firebug lite but other alternative that people use. ...

Hide asp.net Wizard next button in javascript

I want to hide the Next button on my ASP.NET Wizard control using JavaScript. Can anybody tell me if this is possible and post a javascript snippet on how to do this? Thanks! ...

Detecting Disabled Youtube Video

Given an Youtube video id how can I determine from JavaScript whether the video has embedding disabled? ...

Javascript text manipulation

Just starting with js, decided to convert Friendfeed to a fluid app, and as part of that I need to be able to parse some numbers out of a string. How do I complete this function? function numMessages(text) { MAGIC HAPPENS (POSSIBLY THE DARK ART OF THE REGEX) return number; } input would be "Direct Messages (15)" output wou...

jQuery won't replace anymore after the first time

As an easter egg for a part of one of my sites, I have in my footer #left tag a "Easter" egg that changes each time you click it, revealing funny messages: $('#left').append(" <span><a href='#' id='dontclick1'>Don't click.</a></span>"); // time for some fun $('#dontclick1').click(function() { $('#left span').html("<a href='#' id='dontc...

Javascript event not being set correctly in closure when called cross frame

I have the following code in the top frame of a two frame page: function setKeyHook() { logMessage("setKeyHook()"); top.frames.BOTTOM.document.onkeydown = top.frames.TOP.document.onkeydown = function( evt ) { return function(){ t...

Pre-loading external files (CSS, JavaScript) for other pages

I'm curious if there is an efficient way to wait for the front page of a site to load, and then pre-load CSS and script files that I know will likely be needed for the other pages on the site. I want the front page of the site to be as fast as possible (lean and mean). It's likely that the user will not immediately click on a link. Sinc...

Is there a way to collapse javascript or CSS in Visual Studio 2008

It would be nice to have the ability to create 'regions' in js and css files. Much easier to work with. I couldn't find anything on Google about this, but even Dreamweaver can do this. thanks! ...

Is client-side UI rendering via Javascript a good idea?

The "classic" approach to web development has been for some time a thin client and a thick server: the server generates HTML and spits it out for the browser to render only. But with current browsers (and also due to the availability of good libraries and frameworks) Javascript now works. Web devs can now pretty much assume that their Ja...

Is there a way to detect if a browser window is not currently active?

I have JavaScript that is doing activity periodically. When the user is not looking at the site (i.e., the window or tab does not have focus), it'd be nice to not run. Is there a way to do this using JavaScript? My reference point: GMail Chat plays a sound if the window you're using isn't active. ...

How can I process the new content in a text box after the onkeydown event?

I have a text input : <input type="text" onkeydown="processText(this)" /> I have a processing function : function processText(sender) { console.log(sender.value); /// processing.... } But then I check my value, its content hasn't been updated yet. How can I do that? ...

Click event fires in IE/Firefox, but Chrome is dropping the event assignment

I'm in the process of debugging my web application and have hit a wall. I'm experiencing a behavior in Google Chrome only and my javascript ineptitude is keeping me from the solution. I have an ASP page with an <asp:Panel> control. Within the panel, I've setup a simple search textbox and am using an <asp:LinkButton> to launch the sear...

How can I fade in a set of images? not a slideshow

I am trying to figure out how to fade in a set of images similar to how the gallery images are faded in on this site: http://www.archdesignbuilders.com/arch_gallery.php. The code on the site is pretty horrendous to sift through. I can't seem to figure out how exactly they made this effect happen. If anyone has any ideas, I would prefe...