javascript

What's the best choice for developing real time form validation in ASP.NET

I want to make a real time form validation in asp.net form in which when i lost focus a field it show an error or success of field entrance data i search for best way to do that .. and if i want to do the same by validating data from SQL Database ... what's the best choice for doing that ? ...

Facebook Canvas Apps, New API

I'm having some trouble with switching to the new JS API for a number of things with creating applications within FB, specifically the "Tab". <!-- function do_perm() { Facebook.showPermissionDialog('publish_stream,email,offline_access', null); } //--> This no longer works for me when called via an onclick command. Also, with the ...

What is the correct way to create dynamic javascript in ASP.net MVC2?

I'm creating a Google Maps partial view/user control in my project that is passed a strongly typed list of objects containing latitude and longitude values. Currently, this is the code I have for the partial: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<Project.Models.Entities.Location>>" %> <!-- Place...

Get the size in 'px' instead of percents.

Hello, I have to write a javascript function that is returning the current size (in px) of a div. Unfortunately the div has its weight specified in % instead of px. The style of the div: position: absolute; width: 100%; height: 100%; And my width returning function: function getTableWidth(tableId){ var tabWidth = document.getEleme...

html entity is not rendered

If I just put in XUL file <label value="&#176;C"/> it works fine. However, I need to assing &#176; value to that label element and it doesn't show degree symbol, instead literal value. UPD sorry guys, I just missed couple words here - it doesn't work from within javascript - if I assign mylablel.value = degree + "&#176;" - this wil...

jQuery tools tabs fade effect

Hi guys, I used jQuery tools to create a tabs setup, and I would like to incorporate the fade effect, but when I try to do so, it bombs out, here is my code: $(function() { $("#flowtabs").tabs("#flowpanes > div", { history: true, effect: 'fade' }); }); I am assuming that it's because I am also enabling the tabs history? I am kind...

typeof is an operator and a function

In JavaScript typeof is an operator and a function. Is it better used as an operator or a function? Why? ...

Firefox, prevent rendering between javascript statements.

I'm trying to create some kind of zoom around the mouse cursor feature on my website which ultimately runs these two lines (+ the same for height/scrollTop). canvas.style.width = someValue; canvas.parentNode.scrollLeft = someOtherValue; The problem is that in firefox(3.6) the page is re-rendered directly after the first row has been e...

Why does the DOM have both window and self?

Why does the DOM have an object called self and another called window when they are the same thing? To add to the confusion window has a property called self so: window === window.self === self Why is it like this? Which one should I use? ...

Set a callback function to a new window in javascript

Is there an easy way to set a "callback" function to a new window that is opened in javascript? I'd like to run a function of the parent from the new window, but I want the parent to be able to set the name of this particular function (so it shouldn't be hardcoded in the new windows page). For example in the parent I have: function DoS...

AJAX Loader/Progress Bar for Flash File

Hi, I want to implement a progress par using AJAX for a flash file. Please see the demo here http://www.freeplaynow.com/online-games/play/1729/park-my-plane.html Tried to debug their page but the javascript is obfuscated and im not so good in js. Any ideas ? Thanks ...

disable javascript in a UIWebView

Hi, Is there a way to disable the Javascript in a UIwebView ? I have memory consumption problem, and I'm looking for a trick here because it seems to not be be possible with the official stuff. Maybe a call with javascript can stop javascript itself, i don't know. Thanks in advance for any help, Adrian C ...

Debugging dynamically added Javascript code

One of the programmers I worked with has something similar in code: var head = document.getElementsByTagName("head")[0]; var e = document.createElement("script"); e.type = "text/javascript"; var b = "function moo() { alert('hello'); }"; e.appendChild(document.createTextNode(b)); head.appendChild(e); moo(); This is all good and ...

When a li is appended, does it not become a part of the ul "for real"?

I have right now this code: <ul><li class="listitem">text<li></ul> jQuery: $('.listitem').click(function() { $("#elname").text($(this).text()); $('#slists').css('visibility','hidden') $('#elname').css('visibility','visible') $('#elname').css('display','inline-block') }); This is supposed to hide a div and it does,...

how to save xml files using Javascript?

Dear friends, I tried to 1) load an xml file using javascript as an object, say "note.xml" 2) then save the object to a new xml file, say "note_new.xml" I did 1) but failed 2) I tried to use method save() to do 2). After my failure, I checked ms site and they said save() is not supported.... could some one enlighten me how to do...

I want to create a simple function to reset all input values without target input. (Javascript, Jquery)

Hi, I want to create a simple function to reset all input values without target input. I don't know how i can do it. Thanks. Edited: The function resets all of input values. I need to save/catch the target value. Here is my sample codes: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; <...

Possible defect with jQuery ':checked' selector (finding checked checkbox when there are none)

Found a strange thing. The following code is supposed to set a default value for a UI element based on whether one of a group of checkboxes (all having attribute name="privacy") is checked (in say, a form postback). If there is no value in the HTML sent by the server (the form is not a postback), the default value should be firstMenuItem...

javascript error causes page reload?

I have been getting some weird page refresh in deployment and I can't seem to find the cause of it or replicate it in development. Is there a way for a javascript error or exception to cause a page reload? Or some tips to help me narrow down the cause? It happens when deployed in the field and I can't replicate it while testing locally....

Display: Custom Control

Hi folks, I've made a simple custom control: base.Style[HtmlTextWriterStyle.Position] = "absolute"; if (this.Expanded) // If the Calendar is expanded. this.Style[HtmlTextWriterStyle.Display] = "block"; else this.Style[HtmlTextWriterStyle.Display] = "none"; //create th...

No-argument method on window.external is invoked when checking with typeof

Hi, I am trying to display an HTML page with embedded JavaScript code inside a System.Windows.Forms.WebBrowser control. The JavaScript code is expected to interact with the embedding environment through the window.external object. Before invoking a method on window.external, JavaScript is supposed to check for the existance of the metho...