javascript

Mootools background changing.

I want mootools to change the background color constantly. I have no idea how to do this but I have come up with the following code so far as a test but it doesn't work at all. How can I chain colors and then call it again and again so I have this "rainbow" background? function rainbow() { $(document.body).highlight("#fff"); rai...

ASP.Net PostbackURL doesn’t work if I put in Javascript Validation

I would like to share my problem with you in detail. 1) I have a textbox and a button in my page consider it as home.aspx 2) I have written the code like this: <asp:Button id="btnSubmit" runat="server" Text="Submit" PostBackUrl="~\search.aspx" OnClientClick="validate();" /> 3) I have to check wheteher the textbox is null. If...

Eliminate Duplicate Entries

I am using the following javascript to dynamically load the contents of an external page within the parent page. The external page is within the same domain as the parent page and queries a database for blog entries. I am using the variable "eeOffset" to pass a value into the database query in the external page to offset the results retu...

how to set the offset in javascript

How can set the offset using JavaScript ? ...

adding inputs to html form, using javascript

Hello. I have an html form that I would like to add inputs fields to using javascript. Originally I had the input fields by themselves underneath the 'body', and the following was able to add the fields: // Create number input field var phoneInput = document.createElement("INPUT"); phoneInput.id = "phone" + instance; phoneIn...

How to disable user's input while loading page with jquery?

I have a heavy-jquerized page with some links, various user inputs and such. I use jquery, with actions defined in a $(document).ready( function() { .... } ); block. But while the page is loading (or, even worse - reloading), and a user clicks a link, the href action from it is triggered, as the javascript isn't loaded / active ...

Coloring lines inside textarea

Is there any way to make textarea display lines in colors? What I am trying to achieve is every second line colored, i.e. white,grey,white,grey,white,grey... for better readability. Users are supposed to write in lots of stuff, as in "enter names, each one from new line". I do use jQuery anyway so if they made some simpler solution for ...

innerText gives error in mozilla firefox (count words and character of html)

I want to count number of words & number of characters in html text (TEMP), and while doing that i want to skip HTML tags and html keywords (ex. &nbsp;) suppose i am getting HTML text in my JavaScript function as var TEMP= result.data; // where result.data='<p>BODY&nbsp;Article By Archie(Used By Story Tool)</p>'; i have done this...

how to rotate images in banner using Javascript?

hi, how could i change images using JavaScript in asp.net? I want these to be changed after some time intervals (say 15 seconds) automatically (without hitting the refresh/F5 button) using java script ONLY in asp.net. Is there any JS which help me to do this. thanks ...

Active AJAX requests

Prototype stores the number of active AJAX requests in Ajax.activeRequestCount. Is there something similar in jQuery/Mootools etc or something that can be used from XMLHttpRequest?. Ideally I need a library independent method of detecting the number of active AJAX requests within a page. If not, a method for each library would suffice. ...

jsp tag library changes checkbox name?

I'm trying to use a select all checkbox to select a column of checkboxes. So I gave all the ones I want checked off at once the same name ABoxesElement so that I can easily check them all on in javascript. However when I use firebug in firefox I can see that the checkboxes did not keep the name I gave them but pre-pended the component...

Calling a rails function from javascript

Hey all I'd like to trigger an action from my rails controller when the user leaves a page. I fell onto the window.beforeunload event, but I don't know how I can call the function from my controller from the view. I have something like this: //function that checks if someone leaves the page //if so, send mail to admin with uncon...

How to get Dutch locale in Dojo to work?

I need to format a date into a Dutch locale (Netherlands, Dutch language) string. I found that dojo supports this, but I can't get it to work. I am a Javascript newbie. Don't underestimate my blissful ignorence. EDITED <html> <title>title</title> <body> <SCRIPT TYPE="text/javascript" SRC="http://ajax.googleapis.com/ajax/libs/...

prevent autodropdown by jquery datepicker

hi when I append jquery datepicker to my asp textbox, by clicking on it, my browser auto shows the history of the dates i typed in a dropdownlist. Can I prevent this? Set textbox to readonly isn't a good idea because asp.net doesn't read the values from read only fields in code behind. any other ideas? thank you and best regards. ma...

Prototype based language

I am really a big fan of javascript. It is really a great prototype based OOP language. Now I want to learn some other prototype based language. Really really interested in some design guideline i.e How can I manage the code without classes etc. Which language should I choose ? Some resource in design patterns for prototype based languag...

Location Aware Mobile Browsers

I want to build a mobile web application that will require the users location. I want to avoid the need to create applications for separate mobile platforms and the growing sophistication of mobile browsers seems a way around that. Which mobile browsers will allow client JavaScript to use the phone's GPS or cell tower data? There have...

body onload doesn't work in Javascript

hi, i had written one JS in asp.net. I had called that from body onload, but the JS doesn't get called where i have put my debugger. What could be possible reasons for this? I'm developing website in dotnetnuke. The JS i have written is syntactically and logically correct. Thanks <script type="text/javascript"> var displayTime, speed...

simple calculation of integer and decimal number in jquery

Trying to multiply 2 values. Quantity is integer and credit price is decimal number. When I run this code nothing happens. Does anyone know what is the issue? Thank you. $(function(){ // bind the recalc function to the quantity fields $("#oneCreditSum").after('<label></label>Total: Aud <span id=\"total\"></span><br><br>'); ...

IE JS: how to use pasteHTML() when selection.type == 'None'?

I'm trying to allow the user to edit a contenteditable div, but am finding that I can't use pasteHTML unless there is some text selected. I thought document.selection.createRange() would return a valid zero-length selection (i.e. a position), but alas no. I've really struggled to find any solution to this that doesn't involve iframes (...

$('#<%= txtFirstName.ClientID%>'). What do $ and # do in this code?

$('#<%= txtFirstName.ClientID%>').show(); Trying to send ClientId to external Javascript file using server tags as a parameter <input type="text" ID="txtFirstName" runat="server" maxlength="50" class="DefaultTextbox" style="width:180px;" value="First Name" onfocus="ControlOn...