javascript

Dealing with incremental server response in AJAX (in JavaScript)

I have AJAX app which updates page based on server response. The command that AJAX server response is based on takes long time to generate full response, but it sends partial information as soon as it is calculated. This partial response / partial info is send in "burst", and time and size of each burst is unpredictable. CGI script (in...

Javascript Poll server. Will this cause a stack overflow?

I am not too familiar with the specifics of every javascript implementation on each browser. I do know however that using setTimeout, the method passed in gets called on a separate thread. So would using a setTimeout recursively inside of a method cause its stack to grow indefinitely until it causes a Stack Overflow? Or would it create a...

Add div above textbox without changing position of textbox

I need to add some HTML content (images, labels, etc.) above a table cell that contains a text box. There are going to be at least 10 rows per page with 8 columns in each row. All 8 columns contain a text box. I've already put together some jQuery that will show and hide this new content area above the table cell, but the CSS is not c...

Can you declare <canvas> methods within a template in javascript?

Not entirely sure I posed the question in the best way but here goes... I have been playing around with the HTML5 canvas API and have got as far as drawing a shape in the canvas and getting it to move around with the arrow keys. I then tried to move my various variables and functions to a template so I could spawn multiple shapes (that...

Find and replace in a webpage using javascript.

What I want to do is replace all instances of 'foo' in a webpage with 'bar' in a JS bookmarklet/greasemonkey script. How can I do this? I suppose jQuery works, as there're hacks to include those in both bookmarklets and greasemonkey scripts. ...

JavaScript Performance Evaluation

background: I've searched around for a reference, or possibly a tool, that helps you theoretically evaluate the efficiency (resource cost) of your JavaScript. This search has turned up a lot of excellent debugging software, but I can't really find something that helps me optimize the code, by utilizing less resource-intensive methods. ...

How to select child from parent by class starting with $(this)

I'm creating a custom jQuery plugin to add a few images above an input box. The highlight class are working perfectly, but I need help with the selectors on the .toggle() for showing and hiding the INPUTBANNER class. jQuery.fn.inputmenu = function() { function createInputMenu(node) { $(node).bind('focus', function() { ...

updating javascript in the body tag using zend framework

Hi not sure if this is possible or not but I want to programaticaly update the <body> tags to change the onload function in my zend framework application. The App is using layouts so the body tag currently looks like this <body class="trandra"> However in one of my views I have a map from google being loaded and it needs the following ...

Placing content above an <OBJECT>

I've tried setting the zIndex for my OBJECT and it seems that I cannot place any content above it. Is this an IE issue? Any workarounds? I'm trying to display a lightbox type dialog directly above the OBJECT. ...

jQuery button click refresh of jqGrid only firing once

I have the following jQuery code which I'm using to populate a jqGrid. It works perfectly posting to my ASP.NET MVC page on the first click of the button. My problem is, any other clicks past the first it seems to run through the jquery code when clicking the button but it never makes it to the POST page. Any ideas why? <script type="te...

JavaScript string newline character?

Is \n the universal newline character sequence in Javascript for all platforms? If not, how do I determine the character for the current environment? I'm not asking about the HTML newline element (<BR/>). I'm asking about the newline character sequence used within JavaScript strings. ...

Date/Time input for an HTML Form

I'm having trouble finding an elegant way to allow for date/time input in an html form. I am thinking of having drop down menus for year, month, day, hour, minute, second, millisecond that are populated with valid entries only. I could do this by hard coding values for each drop down menu, but I'm thinking there must be a more elegant wa...

Which language is Craigslist written in?

I know, I know - it probably doesn't (and shouldn't) matter - I've read this comment. But as a newbie just learning Python, I'm quite intrigued. The source seems to reference Javascript a few times - would the whole site be in this? Any idea about the rest of the technology stack behind the site? Looking at the technology behind some ...

What's the best way to send JavaScript array to PHP script using GET?

I have an interactive web application powered by jQuery where users can manipulate visual objects on the screen. When done, the "state" of JavaScript objects should be sent to PHP to store into database. I'd prefer to use GET for this, but solution that uses POST to submit the data is also viable. I'm currently thinking to serialize al...

JQuery Progress Bar plugin - 100% width

Again I have a question regarding this plugin: http://t.wits.sg/2008/06/20/jquery-progress-bar-11/ What I want to achieve is to set the progressbar's width to 100% so it is as wide as a container it is in. What I have done so far, I have changed this line in the plugin: $bar.css("width",config.width+"px"); To this: $bar.css("width"...

How can I scale an entire web page with CSS?

Using Firefox, you can enlarge an entire web page by simply pressing CTRL +. What this does is proportionally enlarge the entire web page (fonts, images, etc). How can I replicate the same functionality using simply CSS? Is there something like page-size: 150% (which would increase the entire page portions by x%?) ...

Using an ActiveX control from another ActiveX control on a web page

I'm having trouble calling a non IDispatch method in an ActiveX control that I've written. I have a web page with two separate Active X object both of which I've written. I start by calling a method on the first object which returns an interface pointer to a new COM object that is not co-creatable. I then call a method on this new obj...

dojo dialog - check to see it is loaded

I am running a function that needs to close a dojo dialog if it is loaded. How do I check if a dojo dialog is running? Do I use pure javascript and check by id if it is undefined? if (dijit.byId("blah") !== undefined) { destroyRecursive dijit; } Or do i use a property of the dialog object like isFocusable method isLoaded pro...

The Youtube video in my hidden DIV only starts to load after the DIV is shown

I have a Youtube clip in a hidden DIV on my page. After the page has loaded I wanted the video to load quietly in the background so that when the user clicks the button to "un-hide" the DIV, the video will be ready to go. But the way I have it now, the video starts to load only after the user clicks the button. Is there a change I cou...

accessing c# variable

ASP.NET, C#, Javascript I have an unknown number of results returning from an sql querey. I then make changes to their values with javascript and set a value on a hidden input (generated programatically on page_init). My question is: what's the best way to access the hidden input variables values in the C# code behind file. ...