javascript

Chrome says Cannot read property 'nodeName' of undefined, IE6 is fine, using Google Map API

I have an XML file in the following structure. <NewDataSet> <markers> <name>name text</name> <desc>desc text</desc> <Lat>57.149328033771</Lat> <Long>-2.12561060173764</Long> <cost>9985</cost> </markers> </NewDataSet> I'm using Google Map API to parse and map these, using the following Javascript. function load() { if (...

Allow only two digits after decimal in javascript

I have a variable i=28.57142857142857; I want to alert(i); alert this variable on user screen. But I want only two digits after decimal. i.e 28.57 How to do it. ...

Firefox: window.open prevents img.src from loading

Hi. I've heard some rumors I can't seem te replicate. And now I'm curious if any of you have experiences with this issue. Our analytics system uses JavaScript to generate an image of 1x1 pixels. This 'image' is registering all of our visitors behaviour. Now consider the following (simplified) JavaScript code: function visitLink (url)...

When an anchor link is clicked, how would I add on a pixel value to the coordinates so the target is viewable underneath my fixed header.

I have a header on my website that is fixed and is say 100px high. As the page is scrolled the website's content scroll underneath the header. The problem is, if I now click on an anchor link at the top of the page it will jump to the intended section which will then be hidden underneath my fixed header. Is there a way to have the anch...

How to find that a value is less than 108 and greater than 0 in JavaScript: something wrong in script

I write this code for checking: var num = $("#knum").val(); if (isNaN(parseInt(num))) { $("#errorknum").html("Please define a number."); } else { if (num < 1 | num > 249) { $("#errorkrnum").html("your number must be less then 249 and can be greater than 1"); } ...

Oject Expected Error.

I am getting Oject Expected error.i am unable to find the reason . Can u tell me the senarios when this error ocurs. ...

How to change a default drop down icon of select list

Hi All, Is there any code or site which will provide me a source code for custom select I want to use a image in in place of default dropdown icon.. Thanks ...

Setting onclick event removing the handlers attached before

hello What is the difference betwen setting the onclick function in this way: obj.onclick=new Function('functionname') and obj.onclick=function(){ functionname();}; How can i set the onclick event removing all previrius attached? (using jquery or simply javascript) i try something like this: $(obj).unbind('click'); $(obj)....

Does className exist in Mootools ?

Hi, I want to update this very simple JS to Mootools 1.2 and it's not easy. This function : function changeclass(x){ document.getElementById("content").className = "ziclass0"; document.getElementById("content").className = "ziclass" + x; } is triggered in the DOM by : <div id="someclass"...

jquery manipulate html

my dynamic generated html look like below <ul class="missingList"> <li>Please select at least one answer</li> <li>Please select at least one answer</li> <li>Please select at least one answer</li> <li>Please select at least one answer</li> <li>Please select at least one answer</li> <li>Please select at least one answer2</li> <li>Please s...

How to Validate mac address & ipaddress in client side(using javascript) & server side(using c#)

My team doing a project related to network using Asp.net MVC(c#). I need to validate mac address & ipaddress in client side(using javascript) & server side(using c#) for a simple form entry. I didn't get a good solution for validating mac address & ip addresss. I searched google for finding a good user interface for validating mac add...

show result into html table from database

hi all...i have textfield inside html table..i want after i type something like "name" in another cell can show all information or description about people who have that name...that information are take from "member_table"... <tr> <td> <td> <td><input type="text"........></td> </td> </td> </tr> <tr> <td> //i...

XSLT Client-side in Internet Explorer 8

Hi, I'm trying to perform client-side XSL transformation in various browsers and found this code snippet from W3 Schools: function loadXMLDoc(dname) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",dname,false); xhttp.send(""); return xhttp....

JavaScript: Capturing right click and disabling menu only within certain element

I have coded a jquery script where there is a small grid on screen and using drag and drop users can place tiles on the grid (snaps in place). Currently if you hover over a tile it fades in the option to rotate, but I would much prefer it if you could right click to rotate (making it more natural). I understand blocking right click compl...

Is there a JavaScript lib/toolkit that does sentiment analysis or NLP?

I've been searching around this morning, trying to find whether anyone has put together a JS lib that does either sentiment analysis (or even full on NLP) but haven't lucked into anything other than the Java lib that seems to be the standard and some ruby bits and bobs. Wondered if anyone has come across anything in JS that does more th...

Struggling to create SVG shape using JavaScript

Hi, I have already read the other questions relating to SVG creation using JavaScript and followed any links, but I can't seem to get this to work. Maybe somebody here can spot where I'm going wrong. EDIT: I currently have a div with the ID 'svgbasics' in the body of the document, and I'm trying to create an SVG shape using values I ha...

How to grab frame-based site with js-generated menu?

Hi all. I need to grab site, generated by phpdocumentor. The problem is js-generated menu. For example you can check http://developer.openx.org/api/. OS Linux, preferred grabber is wget. Is there any solution for such case? ...

JavaScript & jQuery; how to do snapping drag and drop

I am looking for advice from all you wonderful people on the best way to do snapping drag and drop. As part of a simple board game I am currently coding in JS (using jQuery for effects) users should be able to drag tiles from a dock onto a grid. How does one complete the following objectives (preferably using jQuery). Enable d...

Get files from input.files instead of value on submit.

Hi, I have following problem. I have input field in form, type of file: <FORM action="http://server.com/cgi/handle" enctype="multipart/form-data" method="post"> <P> What is your name? <INPUT type="text" name="submit-name"><BR> What files are you sending? <INPUT type="file" name="files"><BR> <INPUT type="submi...

Picture in Document

<script type="text/javascript"> picture1 = new Image; picture1.src = "picture/loading.jpg"; picture2 = new Image; picture2.src = "picture/loader.jpg"; </script> </head> <body> <form id="form1" runat="server"> <div> <a href="page5.html" onmouseover="document.picture2.src=picture2.src" ...