javascript

JavaScript random loading message generator problem

I don't know much about Javascript, and this function I wrote doesn't seem to be working properly. I don't know where it is going wrong, just that sometimes it doesn't work properly. Any advice on how to improve it? function GetRandomLoadingMessage() { var d = new Date(); var weekday = d.getDay(); var month = d.getMonth();...

Add option from server to existing Listbox

HI I have an HTML ListBox which contains values of email domains taken from a properties file. In one case, when the page has to be edited, I need to bring the email address value from server and split into two and load the email address into text box and list box for example: [email protected] will be split as myname and gmail.com and m...

How to retrieve an input element and its surrounded span?

For <span id="" ...> <input id="" ...> Is there any way to retrieve span id? input element is embedded within span? ...

Required Field Validator incorrectly failing validation on disabled textbox

A required field validator seems to always to fire when the associated textbox is disabled (whether the textbox contains text or not). When the textbox is enabled the validator behaves correctly. Can anybody tell me why? I've tried disabling the required field validator with ValidatorEnable but that seems to make no difference. Here'...

how to disable textbox depending up on checkbox checked

hi can any one please tell me how to disable textbox, if checkbox is checked and enable textbox if the checkbox is not checked ...

Calling ajax webservice from OnComplete of an ajax webservice call not firing OnComplete 2nd time.

Hi, I have an ajaxified .NET webservice that I call from javascript(mootools) on my ASP.NET content page with a Masterpage firstly to check if the user has associated journalists, secondly to delete the user if no journalists are associated. Both calls to the webservice work, but the onComplete for the second does not in IE8. Using FF 3...

Optimizing a static php website

i am making a "static" php website in this style <?php include "header.php" ?> <?php include "left.php" ?> <?php include "photos.php" ?> In "photos.php" i have 3 heavy javascript files from the lightbox and i thought it could be a good to include the javascript files only in this "photos.php" and not at the "header.php". But javascrip...

Selecting rows in Tablesorter

Hi all, I user Tablesorter a jQuery plugin (I am sure other know about it) in my project. I need to add a feature where in when users click on a row, it gets selected . I tried the following code but, its not working out. $('#myTable tr').click(function(event) { $(this).addClass('selected'); }); Could anybody tell me the best way...

Read Cookies From Internet Explorer

Hi Guys Is is possible to read cookies created in Firefox from a html page that was opended in Internet Explorer? Thanks ...

JavaScript / JQuery array/object problem

$.fn.fieldValues = function(successful) { var values = {}; this.each(function() { if(strstr(this.name, '[]', true)) { var tmp = this.name.replace(/\[\]/, ''); if(typeof values[tmp] == 'undefined') values[tmp] = {}; var x = 0; while(typeof values[tmp][x] != 'undefined') x++; values[tmp][x] = $(this).val(); } else...

Ajax with slide effects onready witout using a toolkit

I'm really not that good at Javascript and that, so I need another bit of help. I want to be able to do a quick bit of AJAX using PHP then when the ajax response is finished show the response in a div and SLIDE it down nicely. The basic AJAX side of it is no problem. But I want to be able to have it slide nicely without using any framew...

can't acces accordion in IFrame

Hello, I am using the accordion from JQuery together with DotNetNuke. Now the DNN page is loaded into an IFrame dynamicly, so an the Page_load event of the page which includes the IFrame, the IFrame is not filled yet. <div class="dvFrame"> <iframe class="IFrame" marginheight="0" marginwidth="0" frameborder="0" runat="server...

Reading cookie expiration date.

Is it possible to read cookie expiration date using javascript ? if yes how ? if not is there a source i can look at. Thanks ...

Programmatically select all rows in a jqGrid?

What is the best way to programmatically select all rows in a jqGrid that is set to multiselect? The code could loop through all of the rows one-at-a-time and select each one, but then the checkbox in the grid header is not checked. I was thinking about just triggering the header row checkbox's clicked event, but that would make assump...

Child div's disappearing on mouseout of Parent div

I have some HTML stuff like this <div id='divItemHolder'onMouseout='HideEditDiv()' onMouseover='ShowEditDiv()><div id='itemName'></div><div id='divEdit'></div></div> and in my script function ShowEditDiv() { $("#itemName").removeClass().html("<a href=\"javascript:Edit()">Edit</a>").addClass("divEdit"); } function HideEditDiv()...

XML Javascript Question

Hi, I hope this question (or one similar) hasn't been asked before. Sincere apologies if it has. From an XMLHttpRequest I'm receiving an XML file like the one shown below: <?xml version="1.0"?> <projects> <project> <department>Engineering</department> <primary>TNT</primary> <secondary>Lighting</secondary> <name>Project Ipsum<...

Javascript is crashing when trying to access silverlight content

I have a web application containing a silverlight control. When the specific page is accessed that contains the silverlight control a javascript is executed and if this script is executed too early, the script crashes the javascript engine in IE, not even a try/catch can handle the error. Simple javascript silverlightHtmlElement.Conten...

Start javascript profiling in IE from js-code

I want to start and stop js-profiling from my js-code in Internet Explorer. Like we can do it in Firefox through: - console.profile() - console.profileEnd() Does anybody know whether it is possible in IE? ...

Automatic re-scaling of Y-axis in Google Visualization API / Annotated Time Line

Is there any way to force the Annotated Time Line graph to automatically change scale on the Y-axis when the user zooms in on a range of dates? Check example below, and note that the value ("price") for 2009-10-09 is about two magnitudes larger than the other values. When the user zooms in on e.g. 2009-10-01 -- 2009-10-08, the Y-axis is...

Sharing ASP.NET MVC partial views between projects

What is the best way to share a common Partial View between applications? I've created a separate assembly containing my Partial View in an ascx file, some scripts that go with that view and an HtmlHelper extension method to make creating the partial view easier. However, when referencing that assembly from an ASP.NET MVC application, i...