javascript

add pages to masterpage gives me javascript error

i have a page which uses some javascript code to run,it was working fine until i added it to master page, on adding it to master page it gives me an error from javascript var fu1 = document.getElementById("FileUpload1"); var ex1 = extension(fu1.value) ; object expected in fu1.value i need to know where to add the javascript in master...

toggling jquery animation getting error

Im trying to have a layer animate/expand hight on click of a "show" button, and then, within the layer, have a button to hide it back to 0. $(".showcart").click( function(){ $("#cart").animate({ height: "400px" }); $(".showcart").toggle();}); $(".hidecart").click(function(){ $("#cart").animate({height: "0px"}); ...

jquery slow apply css class onhover

hello, current situation: i have an <a href=""></a> which has a css background image. in css i have the :hover pseudo class to change the backgroundposition. i would like to fadeIn and fadeOut the two different backgroundimages with jquery i do not have to animate the backgroundposition, but fadeIn and fadeOut two different css class...

JQuery. How to load inputs values to an array?

I have multiple input fields. <input type='text' size='10' name='firstname' id='firstname' /> <input type='text' size='20' name='lastname' id='lastname' /> <input type='password' size='5' name='password' id='password' /> I want to get all their values into a single array with jQuery. Like this one. 1 => 'Barack', 2 => 'Obama', 3 => '...

how to generalize a click function in jquery

I have 13 small pictures and 13 big pictures,if any of the small pictures are clicked it'll show the related big picture, I was just wondering if it was possible to generalize the click function so I don't have to repeat the dame code 13 times, thanks <div id="press_images"> <img id="s1" class="small" src="images/press/...

Preserving the radiobutton values using cookies

I have three radio buttons I want to preserve the radio button values after the browser refresh using cookies. Please help me out. ...

JavaScript exit method

I have a JavaScript method that i want to validate a form if the validation fails so if (validationChecks ...... ){ return alert("message") } else{ //proceed } however no matter what i do in the if the form still seems to submit, any ideas? ...

trying to change width on click

Concerrning this, I wanted to get the same effect, then I thought I'll just change width of my div on click. I have a left sidebardiv and contentdiv on the right, and I have an image with onclick trigger, which hides the left sidebardiv and sets the right contentdiv width to 100 %. It does hide the left sidebardiv but it doesn't expand...

Flash and javascript communication without ExternalInterface

How Can I send data out from flash to javascript without ExternalInterface ...

compress file at client-side

I wanna upload a file to server. But is there any way(using javascript) to compress the image at client-side before upload. ...

Preloader question, preloader not on top of the page

Hello al, I have made a post yesterday (late in the evening), but that one wasn't very clear to you, so I hope this will be better. I have found a code which I'd like to use as a preloader for my website. It seems to work, but the problem is that the complete website is still visible. The maker of this script claims that the preloader ...

What in a GreaseMonkey script can cause Firefox to crash?

I have a relatively large script in GreaseMonkey and it seems to be crashing the browser after some time. It looks like it does its thing and then after a while Firefox just dies. Seems to me that this has to be connected with to my script. The page I'm modifying is google.com and I'm developing the script on Mac. What are the common cau...

Testing for parent window protocol in Opera

I am trying to find out the protocol used by a parent window in a child window. If I use window.opener.location.protocol, it works in everything (IE8, FF3.5.5, Safari4.0.3, Chrome4) except Opera. In opera i get: message: Security error: attempted to read protected variable 'protocol' This used to work fine in Opera, but I guess they...

How can I detect internet conection in Asp.Net MVC to use Google Maps?

I am developing an Asp.Net MVC application that uses Google maps to show Addresses in a map. The problem is that I need to demo the app in an environment not connected to internet. How can I detect with an script that the app is disconnected not to call the Google maps api functions? ...

Changing parent window's URL from IFrame

I have a situation where I have web apps on two different servers, where App1 contains App2 in an IFrame. Any links in App2 can have target="_parent" attribute, which allow those links to open in the top window. However, I can't find any way to get the same behavior in Javascript. I found this page, which claims that the child frame c...

When do you choose to load your javascript at the bottom of the page instead of the top?

I have seen JavaScript libraries being loaded at the top and bottom of the page. I would love to know when to make these choices. All the JavaScript code I've written all work at the top of the page, which includes jquery plugins. When do i load my script at any of these positions? ...

alter divs css with javascript

Hello everybody, Can I change style of some div link. Here is what I mean <div id="somediv"><a href="#">something</a>/div> Lets say I have css like this : #somediv a{ color:#000; } Now for instance upon some action such as mouse click on any element I want to change somediv a link css to #somediv a{ color:#00ffff; } I know h...

JavaScript: How to find out width and height of viewpoint in browser window?

How to find out width and height of viewpoint in browser window? And How to find out how much document scrolled to down and to right? ...

How to refresh iframe parent page after a submit in the iframe?

i have iframe inside a page, and this iframe contain a submit button which will do some function. What i want is: after the iframe submit finish, call the parent page to refresh. i know how to refresh it: parent.location.reload(); But i don't know how to do that after submit finish. ...

JQuery problem with html() handling in Opera

Hello everyone. I have following JS code (stripped to minimal size where problem still exists) <html> <head> <script type="text/javascript" src="jquery.js"></script> </head> <body> <div id="debug">this is <em>test</em></div> <script type="text/javascript"> var string1 = $('#debug').html(); var string2 = string1.replace(/<em>/g,...