javascript

Why can't I set a variable equal to an XMLHttpRequest's responseText value?

If I am within my XHR's onreadystatechange function, I can easily do document.title = xhr.responseText, but if I make the function return the responseText, I can't set a variable equal to my XHR's outerlying wrapper to make it equal the response; is there any way to go about doing this? My wrapper: ajax = function(url, cb) { xhr =...

Lock orientation UIWebView on iPhone

Is there a way to lock the orientation of a UIWebView? With Obj-C, JS, or Html? I don't want to have a button or anything I just want it to be locked to portrait as soon as the app opens up. ...

ASP.net form Double Entry

I have a form that I need the user to be able to type something in a textbox, after they tab out have them enter in the same value in another textbox in proximity to it to assure they entered it in correctly. After that the second textbox is to disappear and they will continue to the next field without ever having a postback. Anyone hav...

Using markers and polylines with google maps api

I have a map and it has both markers and polylines. Now I need to seperate these polylines and the markers on different layers I.E When i want to remove the polylines i just execute the method with layer name that removes the polyline's layer can you please help me with this? ...

putting html inside an iframe (using javascript)

Can I create an empty iframe as a placeholder to later insert html into it? In otherwords, suppose I have an empty iframe with an id, How do I insert html in it? I'm using jquery, if that makes it easier. ...

Access Contents of <noscript> with Javascript

<noscript><div id="example">I want to get this innerHTML</div></noscript> <script type="text/javascript"> alert($('example').innerHTML);</script> This javascript snippet just returns an empty string. Is there a way of getting the contents of a noscript node? p.s. I'm using prototype on this particular project. ...

How to debug a Javascript proxy.pac file used for IE proxy settings?

does someone know if its posible to debug a proxy.pac, this file is written in Javascript. how can it be attached to some debug engine like Visual Studio or any other IDE ...

Is it possible to detect that your javascript code is executing because of an event?

If you don't control the invocation of your code, but would like to know if it's being executed by an event handler, is this possible? ...

jQuery UI slider - can't slide to 0

jQuery 1.3.2 / jQueryUI 1.7 / Slider $("#slider").slider({ range: "min", min: 0, max: 40, value: 0, slide: function(event, ui) { CalculateOrder(event, ui); } }); it starts off just fine, but after I move the slider I can't get it back to 0, ui.Value is 1 when i slide it all the way to the left. I've tried setting m...

Looking for stats on popularity of JavaScript libraries

Does anyone know if there's a site that tracks the popularity of the big/various JavaScript libraries? ...

Javascript "Permission Denied" Error in IE.x

I did the mistake of creating my entire web application and not testing it on IE along the way. I only tested it on Firefox and Safari. The web app runs fine on both Safari and Firefox but it gives a Permission Denied error on IE. I am using Google AuthSub authentication and so for authenticating using Google Account, it first redirects...

Extending Number.prototype in javascript and the Math object?

I've always wondered why Javascript has the global Math object instead of giving numbers their own methods. Is there a good reason for it? Also are there any drawbacks (other than efficiency) to doing something like this?: Number.prototype.round = function(){ return Math.round(this); }; Just to make clear, I understand that const...

Asp.Net c# -> Javascript Ajax

First of all, I'm new to Ajax and I don't quite understand everything about how it's work in Asp.Net. I'm using Asp.Net 3.5 and I have a c# server code that run and when it's have finish it work, it's call a subscribed event that will write the result in a txtbox control. c# code : public partial class TestDBLoader : System.Web.UI.Pag...

Recommendations for simple AJAX?

I want to get smarter in AJAX, but not sure which way to go. I have done some DHTML programming back in the day - like 8 years ago!, before it was called AJAX. I used emacs and hand-coded all the javascript, debugged via "Alert". At this point I think there are frameworks out there that make things nicer and easier, but which ones? ...

debugger warnings while viewing StackOverflow?

In IE I can enable javascript debugging. When I view StackOverflow with debugging enabled, I get a debugger warning on pretty much every page. What's up with that? Am I doing something wrong? ...

Unexpected JavaScript Actions reported by my Users

Hello all, My users keep complaining that a link does not show up for them. For me, I have tested this on several browsers and it works for me. What should happen is that a process is started via AJAX using JQuery and once that is done I keep checking with the server via AJAX how much of the process has been done and once the process i...

Error in HideShowPanel Method: TypeError: document.all is not a function, c#

Error in HideShowPanel Method: TypeError: document.all is not a function Error in SetExpandedDIVInfo Method: TypeError: document.all is not a function ...

How can I return true/false from an animation queue thats inside a click() function?

Hi, This seems so tricky to me that I think I am overlooking something simple here. Can you help me find it? Basically, the situation is this (variables where the name is not important are named with a capital letter) : $('a').filter('somecriteria').each(function() { var self = $(this); self.click(function() { B.ani...

Javascript function doesn't get called - ASP.NET and UpdatePanel

I have the following structure on a usercontrol that is loaded by a page (Parent UC): <UpdatePanel> <UpdatePanel> .. In the codebehind, it loads a Child user control at runtime </UpdatePanel> </UpdatePanel> The UC has OnPageLoad registers a script. ScriptManager.RegisterStartupScript(this, typeof(Page), "Load_" + this.Client...

How to fetch a file on a web server using JavaScript ?

Hi, I am trying to write a small documentation tool to be used from the browser. It would need to fetch source code files from a web server. What would be the appropriate way to fetch files from JavaScript itself and then read them so they can be parsed ? The file to be fetched is on a different web server. thanks in advance, vivekia...