javascript

JS: Remove script from other frame with source on other domain.

Hi Is there a way to remove script from site in frame from other domain? ...

Javascript: What Document object property can be dynamically rendered after a Web page is rendered?

According to a school assignment, only one property of the Document object can be dynamically changed after a Web page is rendered. Is it body or cookie? ...

Resuable Asp.net server control with Quirks and Standards mode.

Hi, I am developing a reusable ASP.net server control that needs to work in IE 6+, FF 2+ and Safari both Quirks and Standards mode. The control will expose two user definable properties height and width both of these attributes can be defined as either a percentage or as a pixel value. Inside the control I have two column Divs that c...

Appended HTML that contains javascript doesn't run, how can I make it run?

I'm appending some HTML containing javascript. <td onclick="toggleDay('+data+',this,\'tue\');">T</td> and <img src="img/cross.png" onclick="deleteAlarm('+data+');"> These two pieces of code are in the big amount of HTML I'm appending. They work fine if they are already there when the page loads but not when I'm appending. What do...

IE fails, when calling functions from external javascript?

I have a piece of code that can be simplified to this: var s='' ; s += "<"+"script type=\"text/javascript\" src=\"http://somehost.com/scripts/FooFunctions.js\"&gt;\n"; s += "<"+"/script>" ; s += "<"+"script type=\"text/javascript\">\n"; s += "FooFunction(42, 'i love cats');\n"; s += "<"+"/script>" ; document.write(s) ; In all brows...

confused -- my XMLHttpRequest has readyState of 0 and status of 200

Hello, I've set a breakpoint in firebug and am examining my xhr object. Its readyState is 0, its status is 200. My understanding is that if the status is 200, the request should have at least started, and the readystate should be at least 1. Can anyone explain what's going on? I'm using jquery's $.ajax to create the xhr object, but I w...

iphone web page transitions

I am developing a web page for iPhones and iPod Touch's. I am using the Universal iPhone UI framework. I need to have silding page transitions, but can't seem to get it working. Is there a good javascript framework I could use that would make this easier? I've done a lot of normal web dev with jquery, but it doesn't seem to like the ...

redirect to another page

< type="button" value="PRINT" onClick="window.open('print.php?id=&sec=&subj=&type=viewrec2&Year=&faci= ','mywindow','width=800,height=800,left=0,top=100,screenX=0,screenY=100')"> when i click this button im being redirected into a new window. the problem is that on the main page where this button is located i want it also to redirect i...

Dealing with javascript events applicable only for certain content

I'm having trouble understanding conceptually what I should do while trying to make my first large javascript web application. Depending on which tab a user has selected, I show different content inside a container. The content is more than just text and uses different javascript functions and events. I am using the Yahoo! UI Library'...

How do I determine the system's Olson zoneinfo in JavaScript?

I'm interested in retrieving the current zoneinfo string ("America/Los Angeles", "Europe/London", etc.) that the user currently has set for their OS in JavaScript. I've found how to get the current offset in seconds, offsets at specific dates, and less exact time zones (PST, etc.) but not the Olson zoneinfo. Is this possible? ...

C# URLDecode turns %5C into \\\\ instead of \

I have a web service method that takes a network login (string) as a parameter. The login is URL Encoded from JavaScript so the DOMAIN\USERNAME is encoded into DOMAIN%5CUSERNAME. When I use the HttpUtility.URLDecode on the string, it escapes the backslash and gives me DOMAIN\\USERNAME. I'm attempting to pass this into a profile provid...

How do I use jQuery's form.serialize but exclude empty fields

I have a search form with a number of text inputs & drop downs that submits via a GET. I'd like to have a cleaner search url by removing the empty fields from the querystring when a search is performed. var form = $("form"); var serializedFormStr = form.serialize(); // I'd like to remove inputs where value is '' or '.' here window.l...

css hover vs. javascript mouseover

There are times when I have a choice between using a css element:hover or javascript onmouseover to control the appearance of html elements on a page. Consider the following scenario where a DIV wraps an INPUT <div> <input id="input"> </div> I want the input to change background color when the mouse cursor hovers over the div. The C...

Building a large form, need advice

I have to build a large form for users to fill out in order to apply for graduate study at the college I work for. There will be a large amount of information to collect (multiple addresses, personal information, business information, past school information, experience, etc...) and I want to know the best way to handle all this. I'm goi...

Javascript files not mapping correctly in ASP.NET MVC?

I am having an issue with my javascript files in a master page ... I have the following: <script src="Scripts/jquery-1.2.6.min.js" type="text/javascript"></script> <script src="Scripts/Plugins/jquery-corners.js" type="text/javascript"></script> This works ... until I start to go deeper into the r...

Submit ajax form on keyboard close without a submit button on the iphone?

I'm having trouble with AJAX form submitting on the iphone. I have a search field at the top with no submit button. My plan is to submit the form when the user hits "Go" or "Search" on the iphone keyboard. Anybody got any ideas? Edit: I have the ajax working but I cant seem to get the keyboard to close after I press search. Here is the...

Can I use Javascript Closures here instead of a global variable?

Current setup: var placeId; function selectPlace(place) { $('#selectPlace').html('Selected Place: <b>' + place.Name + '</b>'); $('#map').hide(400); placeId = place.Id; } $(document).ready(function() { $('#postMessage').click(function() { alert("PlaceId: " + placeId); }); }); Can/should I be using closures? ...

Populating dropdownlist with selectlist in ViewData

I am trying to populate an HTML.Dropdownlist with a selectlist which is populated with a string value (a location address) and text (a location description) fields from a database call. I am passing the selectlist as viewdata to my view. The dropdown populates fine but when I go to use the value it is null or empty as seen by an alert I ...

Is there a Flash onload error event?

Hi people, Is there any way of detecting an error when a Flash-plugin loads its content? Basically, what I want to do is to provide some alternate content, in case something goes wrong when the Flash-plugin tries to load it's .swf file. The .swf file is managed by the client and hence I want to create some kind of fall back default c...

javascript loading conditional statement

I've been struggling for days with getting rid of an error in IE, and to 'almost' no avail. I just tried loading jquery 1.2.6 instead of 1.3.2, and the error has gone away (though the site is noticeably slower now). However, I suspect I may be stuck with this solution. Is there a browser based way to include the script similar to the...