javascript

How to hide a div if validation summary is available in javascript/Jquery

How to hide a div if validation summary is available in javascript/Jquery. ...

Does Uploadify support jQuery 1.4?

Does uploadify supports jQuery 1.4? The site states that it needs: jQuery v1.2.x or greater ... but the demo runs on 1.3.2 and I don't feel like trying to get everything to work just to realize that it's some feature I want later is not compatible with my version of jQuery. ...

javascript source code reuse

I am not familiar with javascript and I have had some exposure to java but I found a web application that fits the goals of my app perfectly. The owner has provided the source by viewing the source in the html and I was wondering how hard it would be to reuse the code to deploy a similar app. ...

how to make a part of the textbox as readonly

i have a tagtextbox on my page when a user selects a category that category name goes to tagtextbox now i want that this category name user cant change but he can append some more tags means first tag becomes readonly and further he can add too in same text box ...

How to pass javascript variable to asp code with ASP.NET MVC

for(var i=0; i<<%=Model.Mydatalist.Count%>;i++) { //then I need to pass i to Mydatalist like Model.Mydatalist[i] } //var myJSdata="<%Model.Mydatalist["&i&"]%>"; is not working.. as system see i (i's value) as a string, and will throw exception: cannot convert string to int. ...

JavaScript: supposed to execute functions sequentially, not actually doing so?

I'm seeing a lot of answers on StackOverflow that say that JavaScript executes code sequentially, but I can actually see my own JavaScript not doing so. From the following code: function centre_map(lat, lng, zoom_level) { alert('centre_map'); map = new GMap2(document.getElementById('map_canvas')); var latlng = new GLatLng(l...

How do I pass a variable number of parameters along with a callback function?

I'm using a function to lazy-load the Sizzle selector engine (used by jQuery): var sizzle_loaded; // load the Sizzle script function load_sizzle(module_name) { var script; // load Sizzle script and set up 'onload' and 'onreadystatechange' event // handlers to ensure that external script is loaded before dependent // code is e...

javascript string difference

Possible Duplicates: single quotes versus double quotes in js When to Use Double or Single Quotes in JavaScript What is the difference (if any) between the javascript strings defined below? var str1 = "Somestring"; var str2 = 'Somestring'; "" and '' mean two very different things to me predominantly writing code in C++ :...

Problem with running totals in jquery

I'm having an issue trying to get an accurate running total for my calculations. When you enter numbers into the input field I get an accurate total for that line item, but the grand total comes out to a higher number. Note that this is a dynamic form and that the id's will change depending on how many form fields I have added to the for...

javascript for (i = 0; i < XXX.length; i++) -> length question

for (m = 0; m < troopsCount.length; m++) { //FM_log(7,"i="+i+" m="+m); //FM_log(7,"tipoTropaPrioritaria[m] = "+tipoTropaPrioritaria[m]); //FM_log(7,"troopsCount[m] = "+troopsCount[m]); //FM_log(7,"availableTroops[m] = "+availableTroops[m]); if ((tipoTropaPr...

sifr not performing javascript action in IE

Hi I'm running sIFR r436 on a site I am developing. I have the sIFR running fine. No Problems, but where it is implemented and there is a clickable javascript action/function (please excuse my terminology) this does not work with sifr is enabled in IE 6,7 & 8. The Javascript in question uses jQuery. All is well with Firefox, Safari and...

How to run a javascript function before postback of asp.net button?

I'm using Javascript to create a DIV element and open up a new page by using onclientclick. This works great. Now, I need to write to it from the server side and this element must be created before it is posted back. How do I get the javascript to execute before the postback? Currently, I have to press the button twice because the elem...

Timed planning Mysql database cleaning

We need to create a script (ajax or php or javascript) that will clean some tables from our database at fixed time. We can not use server features such like Cron tab or others. Any suggestions??? Thanks ...

Is it possible to reload a specific image if it did not finish loading after a preset amount of time? javascript/jquery

I am running a online photography portfolio and sometimes, 1 or 2 images on a page fails to load. and refreshing will display the failed to load image. Scenario: I click on the link and the images start to load. but the page never finishes loading because one of the images fails to load. After a refresh, the browser loads the failed ima...

Map like Java in JavaScript

Is there any way to create Map data structure like java in java script? ...

Jquery plugin seems to leak memory no matter what I do

I've recently been tasked with ferreting out some memory leaks in an application for my work. I've narrowed down one of the big leaks to a jquery plugin. It appears we're using a modified version of a popular context menu jquery plugin. It looks like one of the developers before me attempted to add a destroy method. I noticed it wasn't...

Help with manipulating child/parent elements with jQuery

Currently I have this JQuery script var img = $(this); img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); which successfully turns the following: <img src="photo.jpg" alt="caption"> into this <div class="photo"> <img src="photos.jpg" alt="caption"/> <p>caption</p> </div...

Javascript switch vs. if...else if...else

Guys I have a couple of questions: Is there a performance difference in Javascript between a switch statement and an if...else if....else? If so why? Is the behavior of switch and if...else if...else different across browsers? (FireFox, IE, Chrome, Opera, Safari) The reason for asking this question is it seems that I get better pe...

jQuery RTF Editor

I have seen a lot of RTF editors out there, but I can't seem to find one that will let me preload RTF data and display it properly and then spit RTF data back out to me. Does anyone know of any good ones? For example, if I had this: <textarea id="rtf"> {\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard This is some {\b bold} text.\par ...

Copying data from one text box to another using Java Script

I want to copy data from one text box to another in html automatically ie., as I edit the first text box the second one should reflect the same spontaneously ...