javascript

VEMap: pan and zoom work separately; together, zoom no longuer works

I was trying to make Bing Maps's VEMap compatible with touch devices, in particular the iphone / webkit mobile. In the following example, this works: - pan using one finger - zoom in/out using pinch (two fingers) However if I put both in the same time, then the zoom doesn't work anymore: you can see in the console that VEMap.ZoomIn()...

Problem About HTML Code Created By Javascript Code

I have a javascript function which get datagrid's header into THEAD tags. This code triggered on body onload event and run correctly. However, when i look to view source, i can't see these dynamicly generated codes. I want to see it there. How can I do it? function AddTHEAD(tableName) { var table = document.getElementById(tableName...

The Number Of Fractional Digits Is Out Of Range - Javascript

I am using ajax numeric updown extender control but it is raising an exception "The Number Of Fractional Digits Is Out Of Range" when i change values using the up or down buttons. The structure of my web page is shown below : <body> <form id="form1" runat="server"> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </a...

How to use Custom JS with Django inline

I have Django application with inline in place: class Account(models.Model): ContractNum = models.PositiveIntegerField(unique=True, blank=True, null=True) LastName = models.CharField(max_length=50,) FirstName = models.CharField(max_length=50, ) class Subscription(models.Model): Account = models.ForeignKey(Account, relat...

Truncate a label: find out when text overflows a 2-row 400px-long label.

I have a (fixed-width and height) label which sums up a long list of selection criteria, and the specs say that, if label content exceeds 2 lines @ 400px, it should be trimmed, an ellipse should be added, and the rest should be displayed in a hovered div on mouseover, à la tooltip. I'd like some advice on which is the best way to pick th...

CKEditor force paste from word?

I have a application using the CK editor, where users typically paste content from word. When the paste from word function is used, then the content is cleaned properly. The problem is with users not using paste from word, then the HTML gets into a state that our application can't clean. Has anyone found out a way of either forcing usin...

How to remove DOM elements without memory leaks?

My Javascript build a list of "LI" elements. When I update the list memory usage grows and never go down. I am wondering what should I do to remove DOM nodes without memory leak. I tested in sIEve and it shows that browser keeps all elements which I thought was deleted by $.remove() or $.empty jQuery commands. Help!!! ...

show/hide div based on URL.

url 1 = www.xyz.co.uk/asd.qmd url 2 = www.xyz.co.uk/asd.qmd?getstep=4# I want to show a div(left) when PAGE URL is www.xyz.co.uk/asd.qmd?getstep=4# IN PAGE form.php I write THE CODE <script language="text/javascript"> $(function(){ var locate = window.location; if (locate=="http://localhost/school/form.php") { $('#le...

ping from JS problem when remote IP request HTTP authentification

Starting from Ameer Dawood ideea of ping from JS ( pinger ), I've got a problem when the remote IP is a http server, and request HTTP authentification, the browser pop's up the box for user/password. How can I avoid this, If the remote server request auth, we know that the remote server is responding and I need to call alive() function (...

iphone app similar to calculator on this webpage??

i want to make an app that can act similar to calculator on this page- http://www.mehf.com/HFTOWcalc.htm this calculator is working from javascript file...but i cannot understand the calculations done in the js file..any idea is appericiated..? ...

Javascript-based, server-free CMS?

I remember its look but I can't find it, either here or through Google: Does someone know the name of that JavaScript-based little CMS that doesn't require a server : When you click on any article on the left-side, the article pops up before the currently-displayed articled, and shows "Close this article" and "Close all articles" links. ...

Javascript redirect when clicked on back button

Hi All, I am new to javascript programming. I have a page on which if Back button is clicked, I want to redirect to a new location. Is this possible? I have searched for this & I guess onbeforeunload() can do this, but i didn't get it. Regards. ...

Rails3 + link_to(..., :remote => true) + IE 6/7 does not work

I get this strange error if I use a link_to with the :remote => true parameter in IE 6 and IE 7. IE 8 and all other browsers works just fine: If I commenting out the code for the link (jQuery binding on ajax:success), the error still appears. I don't know how to locate/track this error, because line 1529... does not exists. What is go...

How to get the value of the text box from a HTML Coded String

i have a string like var str='<input type="text" name="se_tbox" value="Beauty is Fake" />'; I want to get only the value of that input box which is stored in str as Beauty is Fake is there anyway to get it? ...

How to use .net Resource files in javascript

is there anyway i can access my resource files (.resx) in javascript? if no then are there any workarounds to diplay messages in javascript in different languages? ...

First steps with Javascript: trying to debug

Hi, i have added to the beginning of my code this great script below. <script type="text/javascript"> alert("pippo"); </script> And it works: when i load the page it shows a small window with "pippo". If i I add this below after the alert: $(document).ready(function() // validate signup form on keyup and submit $("...

Obvserving blur event for select Prototype

I have <div id="myselect"> <select> <option value="0">1</option> <option value="1">2</option> </select> </div> Im trying to get the value of the select on blur. So far I have: Event.observe('#myselect select', 'blur', function(event) { //get value }); Please advise! ...

Need a javascript to enable or disable the check box

Hi all i am having two check box controls in my gridview what i need is if i checked a check box the other should be get enabled and if i uncheck it should get disable is there any way to do it. I write this but i am not getting the required one <script type="text/javascript"> function checkboxClick(checked, boxId) { var childCheck...

Write another language above Javascript VM?

I wonder if it's possible to write a new language above Javascript VM so that you could embed your language - which is based on javascript - and it will work together with native javascript. Example: var person_exists = true; // native js Animal eats banana // my language console.log(person_exists) // native js I've seen Cappuccino...

How to use javascript in .ascx pages

How to use javascript in .ascx pages ...