javascript

MyFunction() vs window.setTimeout('MyFunction()', 0)?

In javascript, is there any different between these two: // call MyFunction normal way MyFunction(); // call MyFunction with setTimeout to 0 // window.setTimeout('MyFunction()', 0); The reason I asked was because recently came across the situation where the code only works if i use setTimeout(0) to call the function. To my underst...

Running an SQL Script with Oracle Application Express

Greetings, I am trying to run an SQL Script uploaded using Application Express (APEX), the web based interface for Oracle DBMS. However, upon clicking the Run button, it does nothing, suspecting any javascript error, I pulled out firebug and there appears to be an error on the js. this.endLine.isPreceding is not a function http://loca...

Javascript Canvas Element - Array Of Images

I'm just learning JS, trying to do things without jQuery, and I want to make something similar to this however I want to use an array of images instead of just the one. My image array is formed like this var image_array = new Array() image_array[0] = "image1.jpg" image_array[1] = "image2.jpg" And the canvas element is written like t...

Progressive enhancement for javascript?

Most people talk about progressive enhancement right now as serving browsers with javascript (enhanced version), and browsers without javascript (simple version). But there is such a big difference in javascript performance between browsers that it may be useful to apply that term to support for choosing between javascript based feature...

Slider problem for buttons

I am using slider module for sliding the content page. I want change the "next" and "previous" button. When the slider page is loaded, I want to hide the "previous" button. When I click the "next" button, the "previous" button should display, and when I go to the last slide, the "next" button should hide. How can i do this? I am using ...

Horizontal text scroller with length detection javascript/jquery

I am looking for a way to do Horizontal text scrolling that only scrolls ONLY WHEN the text length is longer than the container DIV. Any suggestion how to do that? ...

Javascript: How to measure the milliseconds between mousedown and mouseup?

Looks like you can't call setInterval() from the onMouseDown event handler. I tried, didn't work. By John Resig's explanation, this makes sense: http://ejohn.org/blog/how-javascript-timers-work/ So is there any way to measure the difference between the mouse button gets depressed and when it gets released? ...

Marshaling javascript dictionaries to Silverlight

I have had not trouble passing primitive values from Javascript to Silverlight through the HTML bridge, but I keep getting stuck when trying to pass a Dictionary. Furthermore, I can't find a single sample of this working anywhere online, though the MSDN documentation says it should just happen automatically. Instead, I get an error tha...

Javascript Code fails in Mozilla Firefox

function getSelectedRadio(seeker_provider) { var sign; for (var i=0; i<seeker_provider.length; i++) { if (seeker_provider[i].checked) { sign=i; } } if(sign==0) { alert(sign); window.location='updatcty.php'; } if(sign==1) { alert(sign); window.location='../registration_provider.php?proid=2...

how to display text from response from javascript

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page { NurseCounter nc; protected void Page_Loa...

Web browser: Hide mouse cursor

Is it possible to hide the mouse cursor in a web browser? I've done this in Flash for a touch screen application, where a mouse cursor is distracting and unneeded. This time it's for a display screen that is non-interactive, so a mouse cursor is not needed. My gut feeling is there's no easy way to achieve this in the web browser, only ...

JavaScript equivalent of PHP’s die

Is there something like "die" in JavaScript? I've tried with "break", but doesn't work :) ...

IE8: The option tag gets a "selected" attribute by default (And cloneNode makes a mess of it)

IE seems to add automatically a "selected" attribute on the option tag. But then if you cloneNode it, things get weird. If you open a page in IE8 with the code below: <html> <body> <form><select><option>o1</option></select></form> <script> // without clone node var elm = document.getElementsByTagName('form')[0]; ...

YUI Editor: How to make two fix rows of buttons

Current state: I have a lot of additional buttons in my editor-implementation. I already do need two rows of buttons. The linebreak is made automatically and is dependant of the width of the surrounding div. In my case this div can change its size. Now everytime this happens, the buttons are realigned and some buttons move up in the firs...

jQuery UI and using/not using themes

We're using jQuery UI Tabs at the top of the page (with no themes, using our own styles in the screen.css file) and using jQuery UI Datepicker later on down the page. We want to use a jQuery Theme for the Datepicker, but we want to use our own styles for the Tabs. But as soon as we include the Themes, it (obviously) styles both complete...

is metaprogramming possible in Javascript??

Hi, Is metaprogramming possible in javascript?? During my routine work, i happened to write the chained javascript function which is something like LINQ expression to query the JSON result. var Result = from(obj1).as("x").where("x.id=5").groupby("x.status").having(count("x.status") > 5).select("x.status"); It works perfectly and giv...

how to change cached picture from javascript

I have a asp image control. ImageUrl="images/avator.jpg". I'm changing this picture on the server and then setting imageUrl same as previous url on the client. but image don't changed. When i click refresh button, image changed. How to change cached image won't changing url? ...

Problem using onload javascript

Hi, I have used Javascript onlaod like this: function check() { var pic = new Image(); pic.src= "images/first.jpg"; pic.onload = function() { alert("Uploaded"); } } This is html code where the function is called. <input type="button" onclick="check()" value="Check" /> It works for both safari and firefox. Bu...

How to debug javascript in firefox via Visual Studio 2008?

I have scripts in my aspx page, in header section. I want to debug it(with breakpoints) in firefox. ...

how to sum radio button values only one time ?

I am using this code to sum values from multiple radio buttons : $(document).ready(function(){ var total = 50000; $("input[type=radio]").change(function(){ $("input[type=radio]:checked").each(function(){ if (isNaN($(this).val())) { total = total; } else ...