javascript

Extjs 3.x: Can I make a panel or a container movable?

I have an Ext.Container and I need to add to it a user-movable object. I see elsewhere that an Ext.Window is not supposed to be nested into objects, thus what are my options regarding other movable Ext objects? Regards, Casper ...

Gaussian/Banker's Rounding in Javascript

I have been using Math.Round(myNumber, MidpointRounding.ToEven) in c# to do my server-side rounding, however, the user needs to know 'live' what the result of the server-side operation will be which means (avoiding an ajax request) creating a javascript method to replicate the MidpointRounding.ToEven method used by c#. MidpointRounding....

Only one popup per visits... Help Me

Hi all, I have a site using javascript popup effect like this: <script type="text/javascript"> var GB_ROOT_DIR = "greybox/"; </script> <script src="greybox/AJS.js" type="text/javascript"></script> <script src="greybox/AJS_fx.js" type="text/javascript"></script> <script src="greybox/gb_scripts.js" type="text/javascript"></script> <l...

Adding a ContentPlaceHolder to site.master

Apologies for the terribly newb question. We're currently implementing Google Web Optimizer in our ASP.NET Web Application and some of the code is supposed to go in very specific places on certain pages. For example, for the "Control Page" Google has some Javascript that sits outside of the <html> tags. I know I probably don't need to p...

Javascript overwrite events

I have a few elements with a click event: $$('.set_main').invoke('observe', 'click', set_main ); And i want to change the event observer. My question is, do I have to remove the event listeners first with something like: $$('.thumb').each(function(item) { Event.stopObserving(item, 'click', set_main); }); or can i simply overwri...

jquery display an alert after each 50 seconds, how to ?

anybody knows an easy way to display an alert after each 50 seconds in jquery (infinite loop) ...

How to clear validation messages and styles form modal form when closed in ASP.NET MVC

I am using a Jquery UI modal form to post data back to my action and it works fine. However when I put client side validation on and the user closes the modal without submitting the form retains the validation messages and styles. It there away to clear the validation messages and styles in JS on the client? ...

How to add Ajax loader in while loading the page in asp.net?

Hello I want to use an ajax loader while loading the page with transparent background. I tried the following code which displays the loading image but how to cover whole backgroung as transperent. My code is: <div class="UpdateProgress1"> <asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="true"> <ProgressTemplate> ...

Can I get the opener window from a ModalDialog window?

Normally when a window is opened using window.open I can access the caller window by using window.opener(), is it possible do the similar within modal dialogs(window.showModalDialog)? ...

create javascript code from obfuscated javascript code

I want to know is it possible to reproduce obfuscated javascript code(create javascript code from obfuscated javascript code). I have some javascript code in my website. I want to prevent others to edit it. For that I user obfuscation. So I want to know, is it possible to create original javascript code from an obfuscated code. ...

Disable input field when checkbox toggled (JQuery)

I have a list of checkboxes and with every checkbox, there is an input field. If I check the checkbox, the inputfield has to be disabled. Example: Checkbox 1 - Input 1 Checkbox 2 - Input 2 Checkbox 3 - Input 3 The real code: <table id="food" width="580px"> <tr> <th colspan="5">Eten</th> ...

zoom level with satellite imagery using google maps api v3

I am having a problem where if I fit bounds to a single marker there is often no satellite imagery. Is there a way I can set the map to the closest zoom level that still has satellite imagery? I am using Google Maps API V3. ...

What's the best method to reduce the number of external JavaScript calls (HTTP Request)?

Currently I'm having the following external javascript in my header: <script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="scripts/jquery.validate.js"></script> <script type="text/javascript" src="fancybox/jquery.fancybox-1.3.1.pack.js"></script> <script type="text/javascript"...

How can I access html elements that were dynamically pushed into html?

I have got a return from a server which is a block of html, which I unfortunately cannot influence. At the moment it is being dumped into my html via AJAX. The problem is that internet explorer doesnt recognize any elements that come through in this block of html eg I cannot: document.getElementById(someValueId) because internet exp...

Javascript to update contact entity

Hi , I have two fields in contact entity named Last Appointment Date and Next Appointment Date. I want to populate this field with values from the appointment entity when new appointment is created. When i create an appointment i will select a contact name the related contact should be update with the values in the appointment fields. ca...

Problem in graph api

Dear All, I m using graph api of facebook to publish messages on wall.i m using following function which publish messages on wall . function streamPublish(){ FB.ui( { method: 'stream.publish', message: 'hii', attachment: { name: 'testing', caption: 'my name is ange', ...

google maps api v3 no labels?

Is there a way to turn off all labels (street names, state names, country names etc.) from google maps using the API v3? Or are these built directly into the map images? ...

Decoding strings in PHP

Hi, I am working on a PHP application that has to parse strings being sent by another program. the problem is that some strings have octal characters and some other escapes in the middle. So instead of "script>XYZ", I am getting: \103RI\120T>XYZ%6En \151\156 d%6Fcu\155%65n.. And I need to print back this string decoded... I tried usi...

Reading a portion of the ajax html response

Hi there, My ajax (jquery) response (html) gives me a whole junk of html source code since it fetches the enrite page. The response is somewhat like below: <htmlhead/headbodydiv id="content"/div/body/htmldiv id='content'></div>? if yes, how? 2) if #1 is not possible, how could I extract just the content from the <div id='content...

CSRF vulnerability / cookies question

Just want to get input from people who know. I was considering CSRF vulnerabilities, and the seemingly the most popular method I know to fight against it. That method is to create a token in the returned html and adding a cookie with the same value. So if a script tries to do a post they would have to guess the token thats embedded in th...