javascript

How can you get subdomain.site.com and www.site.com down to the domain name

In javascript is it possible to create a function that checks an url to find the domain name. EG: if these sites: www.site.co.uk www.subdomain.site.co.uk site.co.uk subdomain.site.co.uk were put into the function they would be returned as "site.co.uk". ...

Every Object is a function and every function is Object - Which is Correct?

I was reading this link JavaScript_syntax This seems to be cyclic - that every function is an Object and every Object itself is a function. Which is the atomic one? Can someone explain in a better way? ...

Get User Spent Time onunload In Asp.Net and javascript

Hi, I need to get the time every user spent on the page and insert that information to database. When the page loads I assign a start time to a javascript value. on body's onunload function I calculate the time difference between the start time and end time so that I can insert it to database. I use script manager and EnablePageMethods...

How to equalize hights of divs quickly on IE7?

I am trying to equalize "row" hights of a project I am working on and am running into speed issues. I have 60 to 90 rows and 4 to 10 columns. This whole setup cannot be generated in a real table due to other requirements so I have been using the jQuery.equalhights plugin, which works great, but when you get to 240 "cells" it takes about ...

IE Never finishes loading SharePoint page when JavaScript is disabled

I am working on a solution that loads SharePoint pages in a copy of IE. When the page finishes loading an event is triggered that executes some code in the application that wraps IE. Now this all works fine and well, until JavaScript is turned off in the browser, a requirement for this solution (Don't ask). Naturally I don't expect the ...

associative array from javascript to activex object

I need to pass an associative array from Javascript to a C++ activex control in IE6+. It seems a shame to write my own type for something so standard. It doesn't have to work with native JS objects, I can use a custom associative array type if I need. I've been googling for a couple days and there isn't a lot of information on this subj...

cascading dropdownlist without postback

Hi, So, here's the scenario: I have a .aspx page having two dropdowns, the data to be loaded in them is usually static(but may change everyday), the first dropdown always displays the main categories and the second dropdown is initially empty. Now, the requirement is: As the user selects a category from the first dropdownlist, the se...

How can i apply more than 1 style on web page

Hello . I have a drop down list with item: style1 , style2 ,style3 ... THis style are external style. I want to know how to apply this syle in my site when i clik on drop down list. Please help me ...

anybody knows how to close (hide) fbml-dialog using new facebook javascript sdk?

i've wasted 4 hrs today and several hairs trying to solve this issue but failed. we use facebook.connect to auth users on our site and perform various actions. one of this actions should trigger fbml:dialog, i decided to use new js sdk. here's function i use: function popupModalWindow(cat) { var oldSize = FB.UIServer.Methods["fbml.dial...

Save VML and CSS markup

I am using DD_roundies to generate rounded corners in Internet Explorer. The pages that have the rounded elements are loaded very often and the roundies script has to run many times to round corners and fix pngs. This costs a lot of time. The script produces some VML elements that are placed in the targeted elements, and some CSS that it...

How to auto-size an iFrame?

How yo auto-size an iframe when an iframe webpage load? iframe's src to an external site such as "http://www.google.com" ...

Sort multidimensional array in JavaScript

I need to sort an array containing arrays in ascending numerical order. The data structure looks like this array = [[escalation],//integer [name], [email], [blackberry]]; I try to sort the array using this function (sorting by escalation) function sortfcn(a,b){ if(a[0]<b[0]){ return -1; } else if(a[0...

Interpolating RGB color

I'm wrestling with how to interpolate a color, given a start_time and end_time, start_color and end_color. For simplicity, here is an example of how I'm thinking of doing it with just the red component: start_time = 0 end_time = 1 start_color = F //base 16 ftw end_color = 0 I can see how at time .5, red_out should be 8. This would be ...

Dynamic show/hide div with javascript not working

I have a basic show/hide javascript that works, as long as i don't make it dynamic and make sure of a parameter. I would appreciate a lot if anyone could help me figure out why the dynamic version doesn't work. Working code: javascript function togglesDiv(){ var catdiv = document.getElementById("addNewCat"); if(catdiv.style....

How to redirect webpage from one domain to another?

How to redirect domain to another domain, when the first domain (webpage) load? ...

Where Can One Find Examples of ECMAScript.NET's Use?

ECMAScript.NET is an open-source implementation of ECMAScript based on Rhino (JavaScript for Java) written entirely in C#. It's used in Pure.Krome's YUICompressor.NET Port. ...

How to clear the content of a div using javascript?

When the user clicks the button, onclick, the content of the div with id 'cart_item' should be cleared. This question may look silly. i am beginner to javascript. Plz help me ...

& amp in url request

I'm getting values from the database and sending them trough url as request and it request is successful when there is no & in the value from the database now I assume that my request should look like value=something&value2=something with amp &amp; How can I replace all & occurrances with &amp; in the url directly, is it possible to wri...

How to Hide URL Loading In Status Bar ?

how to hide URL Loading In Status Bar in IE and Firefox? ...

Instantly completing the animation queue in jQuery

I need to stop the animation and instantly complete all pending animations. stop doesn't work: Lets say I have animation that moves element that is on 0px by 100px and I use stop when it moved only 50px. The result will be an element at 50px. The result I want is when I interrupt the animation, even if the element is at 50px it will inst...