javascript

GWT's hosted mode not working

I've been stumped for a while trying to figure out why my GWT demo app isn't working in hosted mode so I went back and downloaded the Google Web Toolkit again, unzipped it and simply went to the samples directory and ran "ant hosted". The hosted browser launches and only shows the static html content but none of the dynamically generated...

Hidden login in website - looking for hotkey idea

I am developing a CMS. One of the greatest everyday annoyances when working with it is that when you are on a front-end page, not logged in, and want to make a change, you need to go to the back-end login first, log in, and then navigate to the page you want to change. I would like to introduce a smart little function that pops up a log...

How to check browser state whether it is busy or not?

Hi all, I am having query regarding checking the browser state........ for example i am uploading some data and i am trying to show the progress bar in which i need to check the browser state. Like if browser busy will continue showing progress. I am using only javascript and HTML ...

Click events on overlapping items

I have table row with click event button with click event, that button is on table row and I have problem. When I hit button, row click event execute too, but I don't want this behavior. I want only button click execute, without row click. ...

AJAX won't POST to URL

Hi! Im trying to build a simple AJAX script that uses a form to send parameters to the Tumblr API. This is the current code: <body> <script type="text/javascript"> function ajaxFunction() { var email = document.getElementById("email").value; var password = document.getElementById("password").value; var title = document.getElementById(...

Class keyword in Javascript

According to this article it should be a Javascript 2.0 way to define class. However, I never saw that in practice. Thus the question. How to use class keyword and what is the difference between Javascript 1.x way of doing things? ...

How do I abort print?

Is there a way to abort the print event after a user has pressed the web browsers print button? This works for print buttons within the HTML (jQuery): print_btn.click(function() { if (confirm("Are you sure you want to print? Consider the environment")) { window.print(); } }); Is there a way to do the same with the web...

Is there a profitable way to record user actions in textarea?

I need to send bunch of commands to the server on timer - like: put(0,"hello") del(4,1) put(4," is around the corner") so I need to monitor and record all of the user input and compile/flush it on the timeout (idle), something like macros. I can record all things happening onKeyUp/onKeyDown/onMouseDown/onMouseUp using textarea curso...

How to change table background depending on database textareas 'height' ?

Is it possible to get the height of a 'text' field from mysql? Or the number of linebreaks would also work! I have a table which fetches the 'text' field from my mysql database. The background image of the table is sort of a container... I want the background to change to another (taller) background if the text is vertically high! Poss...

Can we use 2 different url on same anchor tag for javascript disabled and enabled condition ?

Can we use 2 different url on same for javascript disabled and enabled condition If javascript is enabled then link should be <a href="link1"> and If javascript is disabled then link should be <a href="link2"> ...

jQyery bind on ajax load() event

Hi guys. I have a page which display multiple blocks with results details. Inside each block I have some tags with thichbox jQuery plugin attached( class="thichbox"). http://jquery.com/demo/thickbox/ here is an example of one kind of ampersant tag: <a class="thickbox" title="Please Sign In" href="userloginredir.php?height=220&width=3...

JavaScript: Overriding alert()

Has anyone got any experience with overriding the alert() function in JavaScript? Which browsers support this? Which browser-versions support this? What are the dangers in overriding the function? ...

How to generate and transmit a JavaScript variable from MVC Controller?

I'm trying to fill a JSON object with a list of items from the database when the page first loads. This list of items comes from the database. Right now, I've strongly typed the View and am looping through the list of items to build an HTML unordered list, and then in the JavaScript building the JSON object from what's been output in the...

What are the possible ways to prevent form from double posting in ASP.NET MVC?

During a log inspection of my ASP.NET MVC application I discovered that some users managed to post same form twice. I tried to reproduce it but I failed. Anyway I'd like to prevent users from posting same data twice. Is there any canonical solution for that in ASP.NET MVC or I have to develop my own custom solution? I case of custom sol...

Very unusual JavaScript behaviour

Here is something that I've used for ages now and all of the sudden I get these strange behaviours, maybe someone knows the reason why? Here is my HTML: <div class="tooltip" id="tooltip"></div> <input type="button" name="hide" value="hide" onclick="hide('tooltip');" /> <input type="button" name="show" value="show" onclick="show('toolti...

Loop through a set of ids and copy them...

I have an unordered list with ids like so: <li id="e1">01</li> <li id="e2">02</li> <li id="e3">03</li> <li id="e4" class="event_day">04</li> <li id="e5" class="event_day">05</li> And a div with content like so: <div id="descriptions"> <div></div> <div></div> </div> I want to copy the ids of the list items with the class event_day...

Retrieve value of element on dom on page reload

I have the following JavaScript function which is used to keep users from inundating our server with Ajax requests: var validateZip = function () { var lastSuccessful = parseInt(jQuery('#mailingZip').val(), 10); return { validate: function(zip) { var is5DigitNumber = /^\d{5}$/; if (is5DigitNumbe...

Triggering domready by force in jQuery?

Since placing javascript DOM methods in the bottom of the html page (after <body>) is a lot faster than using the jQuery 'ready' event, shouldnt we be forcing it by doing: $('document').trigger('ready'); ...after the body tag? I havent really tried this, but it should speed up things. Or did I miss something? ...

Trigger scriptaculous ajax autocompleter in the update function

I'm trying to create something a text input field where you can enter a kind of path. I try to help the user with autocompletion, so that he may click trough the path instead of writing it down. It works almost, but there is one little problem left. With this code: memoFolderAutoCompleter = new Ajax.Autocompleter('folderPath', 'selecto...

AJAX calls from Apache-hosted file to Tomcat servlet on same server failing.

Why are my AJAX requests failing? I have a website www.foo.com, and I'm running Tomcat on the same server, www.foo.com:8080/services. However, when a file on foo.com makes an ajax call as such: $.get("http://foo.com:8080/services/action.do", null, myCallback ); I get an error response, rather than the xml document I get if I manually...