javascript

JavaScript Modal is Too Big for Screen

I have created a modal window using the Prototype JavaScript framework and the following object: var Modal = Class.create({ animate: function () { this.step = (this.step + 1) % 31; if (this.throbber) { this.throbber.setStyle({ backgroundPosition: 'center ' + this.step * -33 + 'px' ...

Javascript function not working

Hi, Im trying to use the below function to find values in form fields, The reason its loops is because the form changes dynamically which means there could be gaps in the ID of the field Java script function is function totalProductPrice() { var maxid = document.getElementById("field_id").value; var i = 0; var...

Assigning "HTML Select Control" Values in PageLoad() Event.

I want to Use only the HTML Controls on my page. For that i want to use some text boxes and a HTML select(List box) and a Submit button for Post Event. The Code is as follows: <script type="text/javascript"> function dropdown(mySel) { var myWin, myVal; myVal = mySel.options[mySel.selectedIndex].value; if (my...

$(window).load(function()-how it works with FF

Hi All, I have a jquery code. $(window).load(function() { document.title = $("#myid").text(); //not working in FF }); Here I have used $(window).load(function() because in the #myid I am getting value through another javascript, if I use ready(), its giving me error. so I am first loading the window then start reading value. Now ...

How to go about late/lazy loading resources

Hi folks, I have a fairly long page (http://tiny.cc/JrSYr) with sections such as google maps, image slider, google ads, brightcove video (optional) and images. Loads nice and quick without JS and a little slower with JS. I've seen http://www.appelsiini.net/projects/lazyload and was wondering if anyone has used a similar approach or an...

Giving tolltip to Drop Downlist box when it is populated

i want to give tolltip to dropdown list box as like ... when i just click on the DropDownListBox then it populates the list of items. when i move on the on of item then color of that item changes to blue i want to assign the tooltip for this perticular item. bcoz my text of listitem is too large which is greater than width of listbox....

convert string into datetime format in Javascript

i have a string which, i want to compare with a javascript datetime object. how to convert string "1/1/1912" into datetime using JavaScript so that i can compare like if (EDateTime > ('1/1/1912')) {...} ...

How to check if element has any children in Javascript?

Simple question, I have an element which I am grabbing via elementById(). How do I check if it has any children? ...

web proxy handling window.location redirecting

Hello, I'm working on a web proxy and I have problem when a sites is using javascript redirect by doing a window.location = "http://newurl.com"; Is there some way to intercept this and rewrite the url to this format "proxt?url=http://newurl.com" In Firefox its easy, function locationWatcher(id, oldURL, newURL) { return parseUR...

Handle URL anchor change event in js

How can I write the JavaScript callback code that will be executed on any changes in the URL anchor? For example from http://example.com#a to http://example.com#b ...

Howto copy a whole div to another div when javascript is triggered in the div

Hi, I have two columns. People have to select elements from the first column and it will be added to the second column. I can use innerHTML but I never know how many elements there are going to be. So when I click the link 'MOVE' I would have to know the ID of the element (in the example element1, element2 or element3). Does someone kno...

redirect after webmethode

Hi, I'm using javascript to send a array to my code behind so it can be saved. And also to redirecting the page to the next dataset. function ChangeMonth(utcDate){ PageMethods.javaGetArray(colors); alert("saving..."); window.location = "./transport.aspx?date=" + utcDate; } This works perfectly when there's ...

PHP server "stuttering", freezes server

Hello All, We have a particular problem here on one of our production machine, which is running a PHP application. We have an AJAX call that is only called at one location in the code. However, at any given time, when I have a look at the PHP activity file in Linux (suphp_log), I see that when the server freezes (for a couple of minu...

jQuery load() method memory leak?

I have hunted around for answer to this one, and though have found related quesions, I couldn't quite find an exact match for this. I have a fairly large app which is supposed to load pages into divs in another page using the jQuery.load() method. The problem I have is that when loading the same page over and over again into the same d...

How to hide the text box blinking cursor?

I need to hide the text box blinking cursor in CSS / Javascript. Is it possible? ...

setInterval and window.onload problem

Hi all, I have this code window.onload = function() { function foo() { alert("test"); } setInterval("foo()",500) } Which returns undefined...When i use it outside the window.onload it works. Can anyone explain me why? ...

Does the use of AJAX increase memory usage of PHP??

Hello all, I think the answer to this question is no but I do not have anymore leads of the problem I am trying to figure out. I initially had a single script that did some database queries via SQLCMD. I have now decided to initiate this script via AJAX and wait for the response. But I get a fatal error of: Fatal error: Allowed memory...

How to handle drag events on iphone and ipad with javascript/jquery?

Hey, I have a little app that has been under development for some time. My friends and I have been working really hard on this and are near release of the beta version. I want to give some demos using iPhone and iPad to look cool :p Now my problem is how to handle: Mouse Down Mouse Up Mouse Leave The multitouch interface of the iP...

Inline jQuery script not working within AJAX call

Hi. I have a issue: while i call a inline script (wich uses jQuery too) from another page with ajax - it seems, that jQuery is no more defined (?), and I cannot use any of jQuery functions, that should be applied (according to inline script) to content. It's basically a news list, which holds links to particular news items. I prefer us...

Interdependent Callbacks in webOS Programming

This is a conceptual question. Many of the operations that happen in webOS are asynchronous. I have done Ajax programming before, but it feels like webOS takes it to a new level. Take the following example of an application that retrieves a list of news articles from the web, and also caches articles locally in an HTML5 storage database...