javascript

MVC: Retrieving form values after submitting

I have a form on a dialog box like so: <form action="../ControlerFunction"> <input type=text id="id1"/> <input type=text id="id2"/> <button type="submit"> OK </button> <button type="button" class="close"> Cancel </button> </form> When the form is submitted it hits my controller function, but how can I retrieve the valu...

Destroy SWF DOM in swfupload

I am using swfupload for uploading files and I have this problem: In Internet Explorer, I have to use destroy(). Otherwise it crashes http://demo.swfupload.org/Documentation/#destroy In Firefox, if I use destroy(), it crashes. So the solution is to detect browser type and only destroy in Internet Explorer. Is it how it works? Or did ...

Global variables, Javascript

Can I do this ? var global = 0; var truc = $.getJSON("events.json", function(json){ //alert("JSON Data: " + json[0].titre); global = json; }); I want to keep the contents of json and work with it outside the function. If it was C, I would just keep the pointer but I don't know what to do with JS ...

changing css property of target page on submit

Hey there. I have an aspx page with one form submitting to itself. In the form there are 2 divs with various input fields, text, etc. Div1 is hidden via css by default. There is a submit button which postbacks to same page. How do I get the button to alter the css display value to "block" so div1 is now visible? I can get it to the poi...

anchor tag onclick to call a code behind method

Hai guys, I use <a href="javascript:void(0);" onclick="orgvalid();return false;" class="regular">Register</a> in my aspx page... Once true is returned from the function orgvalid() i want to call a code behond function insertorganization()... Is it possible to do so if so how? ...

Making an Ajax call and returning a boolean value in an ASP.NET MVC application

I want to make an ajax call (using JQuery) in an ASP.NET MVC application and return a boolean value, how can I do this? Thanks ...

get value from iframe

i am making website of yellopages in which i want to uploade and display image on same pages. firstly i insert image name in database while uploading.now i want to get image name on parrant page my code is bellow addproduct.php <table width="100%" border="0" cellspacing="0" cellpadding="0"> ...

fastest way to detect if duplicate entry exists in javascript array?

var arr = ['test0','test2','test0']; Like the above,there are two identical entries with value "test0",how to check it most efficiently? ...

How to get clone of HTML, modify it, get HTML string without affecting DOM?

I have some HTML code like this: <div style="background:red;width:900px;height:200px" id="wrap"> <div id="inner" style="width:300px;float:left"> ... </div> </div> I need to: 1) Remove "styles" attribute and maybe some others 2) Leave only "id" attribute 4) Get resulting HTML as a string 5) All of this without affect...

How to break 2 loops in javascript?

I tried this: for(i=0;i<5;i++) { for(j=i+1;j<5;j++) { break(2); } alert(1) }; only to get: SyntaxError: missing ; before statement ...

Why does this javascript work...but this doesn't?

I load everything on my page. At the end, I have this script. <script type="text/javascript">loadNewVideo('u1zgFlCw8Aw',0)</script> It doesn't work. But if I substitute it with this, it works.: <input type="submit" onclick="loadNewVideo('u1zgFlCw8Aw',0);" > In the .JS file, this is the function: function loadNewVideo(id, startSeco...

Can I handle alert inside UIWebViewDelegate?

<script language="javascript"> alert("Hell! UIWebView!"); </script> I can see the alert message inside my UIWebView but can I handle this situation? Update: I'm loading a web-page into my UIWebView: - (void)login { NSString *requestText = [[NSString alloc] initWithFormat: @"%@?user=%@&password=%@", DEFAULT_URL, user.name, us...

How can I Call Jquery Function From Other JavaScript function

How can I call the Jquery Function From other javaScript Function (Not from jquery function) i.e I have written some Jquery code like below $(document).ready(function() { function func1(){ // Do Something. } }); Now I want to call the func1() function from other JavaScript Function i.e Say an Example function...

In javascript, how to redirect to SELF , with an extra variable?

I'd like to grab the current URL. Then, append a "&p=1" to it. And redirect it! ...

Pass backspace key pressed event to the applet and stop it propagation

I have a java applet on web page that allows editing text. When user tries to modify text, pressing backspace button, browser forwards to previous page. If filter backspace pressing like var a = function () { var event = window.event; if (event.keyCode == 8){ alert('backspace'); return false; ...

Replace flash with javascript

Hello all, I have next mission: i have to replace flash alement with javascript in this page: http://www.fplus.si/ (changing the images with buttons for every image) Afcourse it has to look and work excactly the same. I found some jquery modules that do almost like this, but there are not the same. did somebody stumbled upon such modul...

Jquery prevent window closing

I want to ask user whether he really want to leave the page or not, when he clicks the close button just like it done in google docs. How to do that using jquery? ...

Jquery: how to make something fade out when mouse is idle. When mouse moves again, It fadesIn!

I have a div called "#top". I would like it to fade out when the mouse is idle for 3 seconds. When the mouse moves again, make it appear (fade, of course) Does anyone know how to do this? Thanks a lot. ...

Validation of viewstate MAC failed. while submiting a form using javascript

I am getting the below error when submitting an asp.net page using javascript. I have set EnableEventValidation="false" ViewStateEncryptionMode="Never" EnableViewState="false" EnableViewStateMac="false" in my page directive Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configu...

mootools inject function

I have span which i crate like this: new Element('span', {'class': 'file-img', 'html': 'Image'}) I want to inject image to it: var my_img = new Element ('img' , {'src' :'uploading/abc.jpg' , 'style' : 'width:50px; text-align:left' }).inject(file-img, 'top') ; It's not working. Thanks for your help. ...