javascript

Asp.net Menu open submenu on click not on hover

Is there any way to force asp.net 3.5 menu control to open submenues(menuitems) on mouse click, not on hover. I beleive it can be done with javascript or maybe jQuery, because when I click on menuitems postback ocures even if there is no navigation url. I found some javascript function but it only opens root items on click, deeper item...

Custom Radio Div/Images/Buttons

I want the functionality of a radio button, yet have the option of choosing based on an image. For example, I am going to have a label (Payment Methods). I would like to set up various DIV/Images with each accepted payment (Credit/card, PayPal, western union, etc). Instead of choose a small little circle radio button, id rather them jus...

Jquery/Javascript - store last 4 letters of string (cross browser)

Hi, I've written a quick image swap class that switches images on hover by placing adding '_grey' to the image src. The code works great throughout the site in all browsers apart from ie6. The substr doesnt seem to work properly here - any advice please!? Code as follows - $(document).ready(function() { var initImg; $('img.s...

Why jQuery live() does not work ?

I have the following code which work fine: $('.ui-selectmenu-menu a').click(function() { alert('OK'); }); However, if I replace it with: $('.ui-selectmenu-menu a').live('click', function() { alert('OK'); }); it does not work. What could be the reason for that ? (In my case, $('.ui-selectmenu-menu a') elements could be removed and...

jQuery load default page issue

I have this page which loads quotes. It has a search form wherein if the user types in the search keyword, it will load the results via ajax. Now, if I click on the link which should load the default page with the Quotes, instead of the search results page, nothing happens. If I am on the home/default page itself, and click on the link...

What are "top level JSON arrays" and why are they a security risk?

In the video below, at time marker 21:40, the Microsoft PDC presenter says it's important that all JSON be wrapped so it's not a top level array: http://www.microsoftpdc.com/2009/FT12 What is the risk of an unwrapped top level array? How should I check and see if I'm vulnerable? I purchase many components from 3rd parties and have ex...

javascript event

Hi all, I have an interesting question, i hope..I have a textarea in my form..when a user comes to enter values in it it displays some cached values in an autocomplete format..thats fine..I want to call an ajax function after the user selects such a cached value in it..so that the ajax call should pass this selected value..so my ...

cucumber problem when running with @javascript

When I run my feature file without javascript, it passes all tests in flying colors(okay, just one color, green) anyway, when I add @javascript to my last scenario, it suddenly fails the test. I tried tracing the problem by outputing it with puts: this is the culprit line: Then /^the "([^"]*)" option should be selected from the "([^"]*...

how to tell jquery to select a parent element, but not its children?

Im using the following click function on an element: $('#extras').toggle(function() { $('div#extras').show(); $('div#extras').stop().fadeTo('fast', 1); }, function() { $('div#extras').stop().fadeTo('fast', 0, function() { ...

Global instance in prototypal javascript

I am exploring a pattern where you can save a global reference to the current instance for simple use in anonymous functions where the this keyword is out of context. Consider this: var instance; var a = function(id) { instance = this; this.id = id; }; a.prototype.get = function() { return (function() { return instance.id; ...

Javascript list widget that resizes to fill viewport with entries

I'm on the lookout for a javascript list widget that expands and contracts to fill as much as possible of the viewport with the entries contained in it, but no more than that they all can be displayed in their entirety. Eg, if you have a list that looks like this (where they dark grey is viewport size), I'd like the list to be re...

A boolean variable name suggestion.

I have a Method name update, this will be called depending on the boolean variable. I need suggestion how should I name this variable. ...

Google Analytics pageTracker is not defined?

Little bit confused... I am trying to track mailto links being clicked, but constantly 'pageTracker is not defined' is shown. I have the following code just before my end body tag () <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-000000']); // This is my account number, I have added the zeros i...

jQuery: finding ancestors siblings with matching content / tree walking

<table> <tbody> <tr> <td class="TargetRow">Not this one</td> </tr> </tbody> <tbody> ... </tbody> <tbody> <tr> <td class="TargetRow">This one</td> </tr> </tbody> <tbody> ... </tbody> <tbody> <tr class="ContextRow"> ... </tr> </tbody> </table> Given the above HTML ...

How to post two form with single submit click

I had two forms 1.login form 2.Registration form login form has the username and password fields and registration form consists controls for registration like username, city, country, etc., 3. Also, i have some hidden controls like <input type="hidden" name="ctrl1" /> <input type="hidden" name="ctrl2" /> <input type="hidden" name="...

Table header (thead) shifts left when reloaded using jQuery (IE6)

I have a table made up of thead and tbody elements. I have some javascript that performs a callback to the server to filter this table. On return, this code removes the html from the table's parent element before inserting the new table html back in. All this is working fine, except (of course) on IE6. When I do this on IE6, the tabl...

window.open prevent new http request

Hello I have an asp.net web application. Some of my users report me a problem that I can’t understand why that occurred. I have a menu on main page and users choose which services they need. When click on menu item. It open a new full screen window. I used java script for this purpose. window.open('URL "', 'CustomPopUp', 'fullscreen=yes,...

javascript dynamic checkbox checking

I have a form (id="myForm") whose checkbox ("checkbox") I check/uncheck as follows: document.forms['myForm'].checkbox.checked = false; How can I do this dynamically? I.e. have a function where I pass in the name of the checkbox and then check or uncheck it? function check(name) { document.forms['myForm'].**name**.checked = false; /...

Redirect to page with loading animation

I already know this solution. (transfer the slow loading page to a loading-interim-page which shows the animation and then redirects to the actual page) But I would really like to solve this without a redirecting page. Any clue how ? The redirect will be triggered from codebehind... ...

slide effect with jquery

hi I'd like to create a slide effect using jQuery. I have several div's: <div id='div_1'>content currently displayed</div> <div id='div_2' style="display:none">content to be loaded</div> <div id='div_3' style="display:none">content to be loaded</div> The idea is that div_2 appears while sliding and "pushing" div_1 out of sight, a lit...