javascript

Active link style in ASP.NET

Hi StackOverflow, I'm having some trouble with my main menu on my ASP.NET website. What I want is, when a user clicks on a link, it should change it's color to black and remain black until the user clicks on the other links. In other words: I want to highlight the selected link. So far I've got it working using some workaround JavaScr...

Remote validation

below is my code the validation only works without the remote validation. once i include remote validation, it submit the form without completing all the other form validations? $(document).ready(function() { $("#form1").validate({ rules: { firstName: "required",// simple rule, converted to {requ...

Calling a function in an iframe from a parent in firefox

I'm trying to call a function, test(), of an iframe from the parent document using the code subframe.test(); subframe refers correctly to the iframe, alert(subframe) returns [object HTMLIFrameElement], and the function runs in both IE7 and opera (9.23), but not firefox (3.0), chrome (3.0) or safari (3.03 beta windows). I assume these ...

Simple Javascript/JQuery Cookie Question

I've got an animation that I want to play only once and I figured that since the animation was in JQuery, the function to write the cookie file should be as well. So far I've got: $(document).ready(function(){ if (!$.cookie('cookieName')) { setTimeout(function() { $('#intro').fadeOut(1000); }, 5000); }; $.cookie('cooki...

Can't figure out how to make calls against the Facebook ApiClient in the js library

Starting from this very nice article about doing facebook integration using the javascript API, I was able to successfully make several calls against the FB.Connect namespace. I am now interested in calls that are in the FB.ApiClient library, and have tried a few simple ones. I cannot get this to work, is there something I have to do t...

onMouseButtonUp

I need some way to find out when user released mouse button - something like keyUp - but for mouse ... Any ideas? PS: I want to mimic :active pseudo class, and my idea was toDoSomething() on mousePress, and UnDoSomething() on mouseButtonUp ... now ... if you got better solution - hit me up! :) ...

jquery javascript equivalent

I use too much jquery I want to do this with out jquery: <a onclick="javascript:$(this).next().css('display', 'none')"> I thought it was this: <a onclick="javascript:this.nextSibling.style.display = 'none'"> But its not. Style returns undefined. Let me clarify: I want to do this: <a class="errorToggle">error</a> <div style="pa...

dropdown focus on page and enter key press check using jquery/javascript

a dropdown with focus and enter key pressed validate for form. I have a form with elements that are validated by jquery (in the validator function as below) If I have a textbox, and I enable focus on it and press enter, I get all of Javascript validations. $( document ).ready(function() { var container = $('div.errors'); ...

Weird random value as default interval handler parameter

Hi, Just came across this. It's not affecting anything really but i'm wondering why it's happening. If I run the following code in firefox with firebug on: setInterval(function(param) { console.log("param is %o",param) },500); param seems to be assigned a vaguely random value: param is -2 param is -1 p...

When One of 2 select boxes are changed, alert with the value for each select box

Given the following: <div class="filters" id="filters"> <select id="state" name="state" tabindex="1" > <option value="">Filter by State</option> <option value="AL" >Alabama</option> <option value="AK" >Alaska</option> <option value="AZ" >Arizona</option> etc... </select> <select id="availability" availability="products" tabindex="2"> ...

cfajaxproxy with url rewriting

Hi, I've been able to successfully implement the cfajaxproxy tag where the cfc in question is located in the root directory of my site. When a page that is IN the root directory of the site, but is accessed by a rewritten url (eg mysite.com/one/two/ -> mysite.com/two.cfm), the javascript generated by cfajaxproxy does not point toward ...

Best way to do ListView in ASP.NET MVC?

bascially, how should i do it now that using the asp:listview control is out of the question? i am migrating from webforms to mvc and former implementation was in <asp:ListView...> so how should i do it now in terms of best user experience for the user? ie: i will need to ajax everything. thanks ...

Take Pity On My Poor Soul

I was wondering if there was someone out there that would take pity on my poor soul? I have a piece of JavaScript that is trying its level best to put me into an early grave. I am very new to all of this and would be eternally greatful if someone could see thier way to helping me before I lose the will to live. I have to add the followi...

How do I know how to design my callback function for my event listener in YUI?

I'm just starting to use YUI. I'm trying to understand how to subscribe elements to different events. It seems pretty simple. Here's some code that I've been tweaking from Yahoo's examples: // "click" event listener for the second Button's Menu instance var onMenuClick = function (p_sType, p_aArgs) { var attributes = { width: { to:...

ASP.NET MVC displaying user Data such as comments?

hows the best way to display comments/user data from a db using mvc? do we just do our own for loop and manually display it or? will doing it this way cause paging problems in the future? any best methods or practice? jquery? thanks guys. ...

Parsing special strings within a text (eg. "%var%") ?

Hi, I am supplying a Javascript function strings with commands (SVG path commands): eg. "move 10 10 line 50 50" move and line are commands numbers are x, y coordinates I would like to add special strings to these commands, that would instruct the function to use specific variables eg. "move %mouseX%+1 %mouseY%+1" where %mouseX% a...

cross-browser right click plugin with jquery?

i've got a context menu plugin that will show a context menu when right clicking an element. but that doesnt work on ajax embedded elements. so i have to use ajax live that trigger the context menu function when it senses a right click. is there a plugin for jquery detecting right clicks? ...

how to remove body onload function in java script??

I met one critical problem in java script .....help me to fix this....... i have written the onload function in one jsp page say login.jsp... in tat function i used window.open method to open a new window again with the same jsp page login.jsp with disabling the toolbars...... now wat happening is when iam opening same page again in n...

How can I perform flood fill with HTML Canvas?

Has anyone implemented a flood fill algorithm in javascript for use with HTML Canvas? My requirements are simple: flood with a single color starting from a single point, where the boundary color is any color greater than a certain delta of the color at the specified point. var r1, r2; // red values var g1, g2; // green values var b1, ...

Returning a byte string to ExternalInterface.call throws an error

I am working on my open source project Downloadify, and up until now it simply handles returning Strings in response to ExternalInterface.call commands. I am trying to put together a test case using JSZip and Downloadify together, the end result being that a Zip file is created dynamically in the browser, then saved to the disk using Fi...