javascript

Javascript to take a screenshot of a website without using ActiveX

I have a JS app that an user interacts with. I need to save the appearance of the interface at the current time, crop out the part that I need (or only shot the part that I need by specifying the div), and send it back to the server. Clearly any external services would not be able to do this, I need a javascript (or flash) script that c...

How to check if a div has element innerHTML

I have a div, which contains n number of child nodes. I have a for loop: for (iloop = 0; iloop < summaryDiv.childNodes.length; iloop++) { if (summaryDiv.childNodes[iloop].innerHTML.contains('display:block')) { flag = false; } } Here some of the child nodes don't contain the element innerHTML. I need to check if the chi...

IE conditional statements do not work with JavaScript disabled? [SOLVED]

I have a page with IE conditional comments in head section, nothing fancy just: <!--[if IE 7]> <link rel="stylesheet" href="css/IE7.css" type="text/css" /> <![endif]--> As I'm at work ;) didn't have a chance to setup testing page yet, but long story short it works as expected when JavaScript is on. When JS is off IE dosen't seem t...

Developing Patterns in javascript

How to create different patterns (like coverflow) in javascript? I don't want to use the already existing plugins provided by JQuery and other frameworks. I want to try developing from scratch. Any place where I can get documentation or tutorials to start with ? ...

Connecting to remote hosts in an HTML/Javascript web app

I've been thinking of developing a web application using HTML and JavaScript for a little while now, but I've hit a wall during my ponderings. I want to be able to connect (long-term, not briefly) to a remote host with this app, one which is unfortunately not the server that the page was requested from. From what I've read, JavaScript c...

Syntax vs Element vs Tag vs attributes vs property vs selector?

Can anyone give me deatails on each? for example? Is #ID an attribute or property or selector or anchor? Is default property and default attributes are different thing? Are all these Tags or elements? What we will say to this <img src="angry.gif" alt="Angry face" title="Angry face" /> This <div>.....</div> and these <br /> ...

How to Remove last Comma in Jquery?

Here is my code in which i generate comma separated string to provide a list of id to the query string of another page and i get the comma at the end of string. <script type="text/javascript"> $(document).ready(function() { $('td.title_listing :checkbox').change(function() { $('#cbSelectAll').attr('checked', fal...

Prototype - get value inside table cell

I have the following piece of code (Prototype): $('table_cell_id') That cell contains a number. How would I get this number into a JavaScript variable? ...

javascript - stop browser highlighting images

I have made a script that allows users to drag images around. Unfortunatly though most browsers higlight the image blue. Is there a way to disable this behaviour in all browsers? ...

Click (mousedown) event of a select element

I have an empty select element, I want to execute some code when that element is clicked on, but I do not want the dropdown list to appear, here is what I have found: When I disabled the select element I cannot catch the mousedown event. When I enable the select element I can capture the mousedown event but the dropdown list appears. ...

open file dialog box in javascript

i need a solution to display open file dialog in html while clicking a div . the open file dialog box must open when the div is clicked. note : i dont want to display the input file dialog as part of html page. it must be displayed as alert in javascript. [i need open file dialog box when a div is clicked. it must be as like alert whic...

integer to two deciaml places

Hi, I have a number in javascript, e.g. 556633. How can I convert this to be £5566.33 Thanks Jon ...

Open Select using Javascript/jQuery?

Hello! Is there a way to open a select box using Javascript (and jQuery)? <select style="width:150px;"> <option value="1">1</option> <option value="2">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc arcu nunc, rhoncus ac dignissim at, rhoncus ac tellus.</option> <option value="3">3</option> </select> I have t...

Google Maps API Sidebar

I'm adding markers and sidebar this way: <script type="text/javascript"> //<![CDATA[ if (GBrowserIsCompatible()) { // this variable will collect the html which will eventually be placed in the side_bar var side_bar_html = ""; // arrays to hold copies of the markers and html used by the side_bar // beca...

Jquery checkbox problem

Hi this is my check boxes <table cellpadding="0" cellspacing="0" border="1" bordercolor="red" width="100%" > <tr><td width="50%"><input type="checkbox" name="businessTypeGroup" id="chkAll" value="0" >All</TD><TD><input type="checkbox" name="businessTypeGroup" id="chkBuyer" value="1">Buyer/Importer</td></tr> <tr><td><input type="checkbox...

Location Sensitive Web Site Splash Page

I need to organise my companies websites so that depending on the location of a user they get redirected to a country specific version of the site e.g. US Users get redirected to a US specific page UK users get redirected to a UK specific page. I've seen this done plenty of times but am not sure how its implemented. I'm thinking som...

Javascript function to validate time 00:00 with regular expression.

I am trying to create a javascript function with regular expression to validate and format the time 24 hours, accepting times without semicolon and removing spaces. Examples: If the user types "0100", " 100" or "100 " it would be accepted but formatted to "01:00" If the user types "01:00" it would be accepted, with no need to format. Th...

How to produce a time delay in JavaScript for a chat App?

I'm currently a beginner at JavaScript and predominantly code in Java. My Question is is regarding invoking the document.write("string here") periodically (every 1/2 seconds) to append any new unprinted chat message to the client. I earlier tried using the following code : <html> <body onload="yantra();"> <script type="text/javascript"...

Google Chrome window.open height includes URL bar

When we open a window using: window.open("/calendar",'calendar','width=950,height=576,titlebar=no,statusbar=no,menubar=no,resizable=no,scrollbars=no'); Firefox 3 and IE 7 open it to have a content area height of 576 plus the browser items (URL bar, status bar, etc). Chrome however opens it to have a total height of 576 meaning a scro...

How to enable background printing by default using css or javascript?

How to enable background printing by default using CSS or JavaScript from all browsers' default settings? ...