javascript

How to set checked value for a radio input tag using ASP.Net?

I have this radio tag: <input name="phoneRadio" class="phoneRadio" id="rbDefaultPhone" type="radio" checked="<%# GetIsChecked(Eval("IsDefault")) %>"/> in a repeater and GetIsChecked is a c# function which return bool value, my problem that its not affecting the checked value of the radio button the right way, Any one know how t...

Error while accessing ASP.net webservice using JQuery - JSONP.

Please look at the code below and help me to figure out what am I doing wrong in my web service code. I want to set up an asp.net web service that can be consumed using an JSONP. I am using Jquery at client side to access the site. Even after setting up proper attributes my web service still emits xml due to which the aynch call fails. ...

Bookmarklet: Append hidden iframe to page and load url

I have a bookmarklet for resetting my router. I just need to visit and let the page finish loading, then my router starts resetting. javascript:(function(){w=window.open("http://192.168.0.1/goform/formReboot","","width=1,height=1");self.focus();window.onload=w.close();})(); But it opens in a popup window. My new idea is to dynamicall...

How to scroll to an element inside a div?

I have a scrolled div and I want to have a link when I click on it it will force this div to scroll to view an element inside. I wrote its javascript like this: document.getElementById(chr).scrollIntoView(true); but this scrolls all the page while scrolling the div itsself. How to fix that? I want to say it like that MyContainerDiv...

How to stop IE from displaying URL in IFrame when changing the parent window

When using javascript:parent.location.href in an IFrame to change the parent window, IE briefly changes the IFrame content to list the url that the parent is changing to. Firefox, chrome, and opera just change the parent window. Is there a way to make IE skip showing the url in the IFrame and just change the parent? [edit] here is ...

C# WebBrowser control -- Get Document Elements After AJAX?

Hello. I'm writing an application that uses the WebBrowser control to view web content that can change with AJAX that adds new content/elements. I can't seem to get at the new elements any way I've tried. BrowserCtl.DocumentText doesn't have the up-to-date page and of course it's not in "view source" either. Is there some way to get thi...

Unobtrusive Javascript to insert element that contains a Rails RESTful URL?

I have a simple page with a single rendered iFrame. There's a link called "Add File" and unobtrusively I would like to attach an event to the "Add File" anchor so that when clicked, it inserts a new iFrame below the existing one with the ID of the iFrame incremented. An example of the iFrame would be: <iframe name="uploadForm1" id="up...

How do you write in JavaScript a empty key from JSON?

Hello todos! Let's say you have the following JSON object {"":"some text"} How do you retrieve it in JavaScript? json_in_var={"":"some text"} alert(json_in_var.) I'm perplexed on this one, any help welcome! ...

Javascript regular expression to strip out content between double quotes

I'm looking for a javascript regex that will remove all content wrapped in quotes(and the qoutes too), in a string that is the outlook format for listing email addresses. Take a look at the sample below, I am a regex tard and really need some help with this one, any help/resources would be appreciated! "Bill'sRestauraunt"BillsRestauraun...

Function Variable passed to setTimeout not working??

Can anyone tell me why this isn't working? function changeBG(element_id){ document.getElementById(element_id).className= "arrowActive"; setTimeout("document.getElementById("+element_id+").className= 'arrow'", 300); } In firebug I get an error saying that the element_id passed to setTimeout() is not defined. ...

Javascript Sprite Animation Library for Canvas Tag

Can you point me to a good Javascript sprite animation library using the HTML Canvas tag? A few Google searches only turned up some non-canvas projects. I am looking for something clean and simple. Thanks. ...

Implementing a simple feedback form in JS

How do I implement the feedback form that the following sites have?: http://foodoro.com/ http://www.heyzap.com/ (look at the left center.) Thanks! ...

Why would jquery return 0 for an offsetHeight when firebug says it's 34?

So I have a div who's content is generated at runtime it initially has no height associated with it. When it's generated according to firebug and from what I can alert with js the div still has a height of 0. However, looking at the read-only properties with firebug I can see that it has an offset height of 34. It's this value that I ...

What's different between Python and Javascript regular expressions?

Are Python and JavaScript regular expression syntax identical? If not, then: What are the important differences between them Is there a python library that "implements" JavaScript regexps? ...

How to iterate through objects in ViewData via javascript on the page/view?

Hello all, First off, I am fairly new to MVC and jQuery. I apologize if my question or terminology is incorrect. I currently have a view in my MVC application that displays a list of addresses. On the same page, I also have a map where I wish to map these locations. I am trying to find the 'proper' way of getting the list of address o...

What tool can I use to find out what JavaScript events are being called when leaving a web page?

I have a set of pages that have tons of JavaScript on it: Table sorting, AJAX calls, autocomplete, dynamically hiding and displaying areas of the page, etc... The problem that I am seeing is when the data on said page gets large a delay (browser freezes) is noticed when leaving the page. This delay happens when the user clicks away, clos...

What is the best way to implement data binding with a web application?

It doesn't seem like there is an obvious to implement databinding using jQuery or any other javascript framwork. I'm wondering if anyone has implemented databinding using jQuery in the same vein as WPF databinding, or even your standard databinding scenario (fill a table with the results of this resource). ...

ASP.Net, Drag-n-Drop, Postbacks, and Control IDs

The title attempts to summarize the problem, but here's a more detailed summary: our web page is a collection of usercontrols, which visually render as rectangular reporting widgets, which are set in AJAX updatepanels. We are giving the user the ability to drag and drop the widgets to pre-set "zones" on the page. The drag and drop fu...

Why does the function run when there are no elements found?

I have the following code, however if the input.formdate is not found it will still run the getDateFormat function. This doesn't make sense to me. Does anyone know the reason? $(function() { $("input.formdate").datepicker({ changeMonth: true, changeYear: true, dateFormat: getDateFormat() }); }); function getDateF...

Best UI Library to use with jQuery

What do you guys recommend for a UI library to use with jQuery. jQuery UI seems to have less widgets compared to other frameworks. I've been playing around lately with the Dojo Toolkit which seems pretty nice so far, and I know that there is always the Yahoo! User Interface, but is there anything else? I also need to consider licensing...