javascript

Javascript OnMouseOver and Out disable/re-enable item problem

I wanted to have some radio buttons that disabled when the mouse went over and enabled again when it went out (just for fun). <form> <input type="radio" name="rigged" onMouseOver="this.disabled=true" onMouseOut="this.disabled=false"> </form> When the mouse goes on it it does what it should be when it goes back off the button wont re-e...

Why I could not add mousemove event after mousedown in prototype?

I would move my former js codes to more OOP style. Here's the code. function addEvent( obj, type, fn ) { if ( obj.attachEvent ) { obj['e'+type+fn] = fn; obj[type+fn] = function(){obj['e'+type+fn]( window.event );} obj.attachEvent( 'on'+type, obj[type+fn] ); } else obj.addEventListener( type, fn, false ); } function ...

How to create Rounded Corners using Css or javascript..

Duplicate: What is the best way to create rounded corners using CSS? I want to create a table with some colums where each column has a rounded corner. I am not an css expert. I think js solution should be fine too. If anyone has done it.. I will really appreciate if they can help. I am not using Jquery. thanks, ben ...

How to create a modal popup using javascript and CSS

Actually, two questions: How can I create a modal popup with background color of gray? Also I need to create for a cover background color only to table itself. Not to overall page. How do I do this using javascript and css? Thanks & Regards Ravi ...

jQuery: The 'body' element is activating the scroll event twice

Hi guys, I've implemented an animation for my photo blog. I still have big problem because the 'body' element is activating the animation twice. I think the problem stems from the $('body').animate. Because I think that when the body is animating, the scroll event would be activated again and thus triggering the event twice. The proble...

How can I display a status message while a file is uploading?

Can any one give a simple method using JavaScript to display a status message while file is uploading and fade away when file is uploaded? ...

Vertical aligning in CSS?

So I know all about the problems with vertical-align: middle; and the different methods people have used to vertical align elements in CSS. But I haven't found one that works for what I need it to work for. Basically my page has just one <div> on it, which I want positioned in the center of the page, both horizontally and vertically. Ob...

reading a json object in jsp

i have a JSON object passed to the jsp page. it is passed as a string. now i have to parse this string and retrieve the values that are passed through the JSON object. so that i can print the values in the same jsp. ...

Trying to access javascript elements inside a page

I hope someone can help me. I'm trying to access the text box inside a webpage so I can do some scripting, e.g. placing text in fields, checking a box and clicking submit, to automate my employees' workflow. It's confusing as heck because I cannot find the name/id/whatever that will allow me to manipulate the form. I can see the name of ...

Best reference sites for HTML and JavaScript programming

Best reference sites for HTML and JavaScript programming: SitePoint: DOM JavaScript, HTML, CSS -- Search W3Cschools: DOM, JavaScript, HTML, CSS, XML, Multimedia, Server-side Mozilla Dev Center: DOM, JavaScript, JS Lang, AJAX, HTML, XHTML, SVG, Standards Quirksmode: DOM Javascript, CSS, Compatibility ZVON: HTML, XML, CSS DevGuru - Java...

JavaScript TextNode update

If I have a var t = document.createTextNode(text) parent.appendChild(t); Is it possible to simply update the contents of t? I would like to change the text inside the parent without using removeChild, createTextNode and appendChild. Why would I need this instead of just using innerHTML? Because I don't want to update the contents of ...

doing substring in window.location.hash

Somehow window.location.hash is being handled differently in different browsers. If I have a url as follows http://maps-demo.bytecraft.com.my/postdemo/parcel #parcel/history/1?as=json&desc[]=ctime&desc[]=history_id and I am interested in getting values in between #parcel/history/ and ?as=json ... so the substring statement would b...

How can i load a picture with jquery?

Hi, i am currently working on a class that generates diagramm's as pictures with php. I want to load these pictures dynamically with jquery. How can i do that?? I wont have a real picture file, just the content of the file when i call it with ajax... And i cant simply define the phpscript as the src because i need to pass Post Parameter...

Modify the URL without reloading the page

Is there any way I can modify the URL of the current page without reloading the page? I would like to access the portion before the # hash if possible. I only need to change the portion after the domain, so its not like I'm violating cross-domain policies. window.location.href = "www.mysite.com/page2.php"; // sadly this reloads ...

How can I use Ajax, perl and JSON easy together?

I am trying to make a webpage with Ajax. Example: I create a Perl/CGU file that triggers a simple post; File: ..test.cgi?name=Thomas Text back: Your name is Thomas! I create a html file that can use the post, but then the page have to reload. I use text input and a button. How can I use Ajax, Perl and JSON easy together? This is h...

calling setTimeout from a form with quotes

I have a html form for uploading a file, which is as follows: $uploadhtml = htmlspecialchars(json_encode("<form action='up.php' method='post' enctype='multipart/form-data'> <label for='file'>Filename:</label> <input type='file' name='file' id='file'/> <br /> <input type='hidden' name='pk' value='".$pk."'> <input type='hidden' name='use...

Javascript and ASP.NET 2.0: How can I know if the page is valid (after validation takes place) in Javascript code on the client?

I need to know if all the client-side validator checks have succeeded, or if one or more validators are not valid. I suppose there should be a variable on the client-side (like its counterpart Page.IsValid on the server) that reports whether the page is valid. Am I right? Anyone any ideas? ...

problems with htmlspecialchars

I am generating links from the following php code. The links appear in the browser, and the generated html code seems fine, however the links are not click-able. I have tested this in IE and FF, and tried to see with FireBug to no avail. The code to generate my form $uploadhtml = htmlspecialchars(json_encode("<form action='up.php' meth...

Dynamically insert an HTML string into the HEAD of a Document

I need to insert an HTML string into the <head> tag of the current document DOM, one way is: you create a div element, fill its innerHTML, copy over item-by-item into your <head> element. But these methods do not work in IE/Opera for reasons given below, though in FF3 both the below methods work perfectly, and the browser processes the a...

Firefox 3.5 does not allow creating OBJECT tag with Javascript?

Firefox 3.5 does not allow creating java OBJECT tag with Javascript (document.write)? this technique works nicely with all other browsers and older firefoxes. is it a new security limit? ...