javascript

How to get image to pulse with opacity with JQuery

I am trying to get an image to change opacity smoothly over a duration of time. Here's the code I have for it. <script type="text/javascript"> pulsem(elementid){ var element = document.getElementById(elementid) jquery(element).pulse({opacity: [0,1]}, { duration: 100, // duration of EACH individual animation times: 3...

Will JavaScript evaluate a property's value if it's not part of an assignment statement?

I've come across a fairly obscure problem having to do with measuring a document's height before the styling has been applied by the browser. More information here: http://sonspring.com/journal/jquery-iframe-sizing http://ajaxian.com/archives/safari-3-onload-firing-and-bad-timing In Dave Hyatt's comment from June 27, he advises simp...

make a button to change the parent's CSS classname attribute

so I have a javascript function that changes the class name of a div function flip (event) { var element = event.currentTarget; element.className = (element.className == 'card') ? 'card flipped' : 'card'; } How can I make it so my onclick="flip(event)" can be attached to a button (or preferably an image) and the button will then f...

php Mail function; Is this way of using it safe?

I have a classifieds website, and inside each classified, there is a small form. This form is for users to be able to tip their "friends": <form action="/bincgi/tip.php" method="post" name="tipForm" id="tipForm"> Tip: <input name="email2" id="email2" type="text" size="30 /> <input type="submit" value="Skicka Tips"/> <input type="hidden...

Drag big picture in small layer?

Hi, I need a plugin for jquery or another js framework, where I can define a small div where i can drag around a big picture, so i get only a clipping of the picture. any ideas? edit: i try to explain i have a small div, like 600px x 450px. this div behaves like a clipping window for a big picture with like 3000px x 2000px. so i only ...

Google Gadgets and external scripts

I'm trying to create my first custom Google Gadget to be used privately in my company's Google Sites intranet. Ideally I'd like to just show a thumbnail that the user can click that will open a modal window with the full video. This requires my including a couple of small JS libraries in my widget. For my widget I created this XML: <?x...

Google Map Web Service working on local but not online

Hi all, I have a problem with a Javascript request to the Google Map Api Web Service : if I have the HTML file on my computer it works, but it doesn't work online. Here's the code : url = 'http://maps.google.com/maps/api/geocode/json?address=Senador+Francisco+Quindimil+Y+Carabobo+Por+Carabobo,Ciudad+Autonoma+de+Buenos+Aires,Argentina&...

Learning HTML5 & CSS3. Do I need javascript too?

I'm familiar with the way html & css work together. Recently I was previewing some html5 content demo'd by apple and saw they used a html5/css/javascript. I'm at the point where I need to know whether or not javascript is a must-learn; or if I can find similar workarounds with CSS3 & HTML5. Edited to clarify intentions: My aim is to ...

Possible to bind an event listener to a (hypothetical) onChangeInnerHTML event?

In my app, I have an OL tag whose contents are changed by various other dynamic events. Is there some way to put a listener on that OL so that I can execute a function whenever its contents are altered in any way? In this example I need to update a count of items in the list which appears in another spot in the interface. I am using jQu...

Pulse effect with jQuery

I still cannot seem to get pulsing images to work with jQuery. This is code that apparently should work but does not. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title>test</title> </head> <body> ...

jQuery encoding values differently than expected for jQuery.ajax data elements

I'm using jQuery.ajax() to make a PUT request to a REST web service, but seeing some really strange serialization behavior. (Before you say it: Yes, I know that not all browsers support PUT -- this is just an example implementation for an api/framework, and ultimately will not be called by a browser, but rather by a server-side library ...

Prototype Selectors

Hi, I have been trying to use Prototype to do some DOM manipulation, but I am not able to find much help on a certain selector. I have a table with many rows and each of these rows has 4 columns, with each having a different class name. Some of the cells might be empty, i.e., they do not have a class, in a particular row. Now, when ...

Find hourly rate for a freelance Js Unit testing project

I have been offered to work as a freelancer on js unit testing project for a famous company (they develop a very popular library). I have written an open source project that allow to run and to write easily unit test for this library. Now, they ask me my hourly rate. How much do you think I can ask reasonably ? What's the hourly rate of ...

Keystroke working in IE not in Firefox.

I am just trying a simple application, to make the browser fullscreen. this is working for Internet Explorer, but not for firefox. Also I want to know, that can the same thing be done in Mac OC? do i have to make changes for Mac OS (using safari, firefox etc) the code it below. <html> <head> <script type="text/javascript"> funct...

Why is Rhino unhappy with this javascript?

I have been successfully using my code with the javascript library in the ANTLR javascript target in a few browsers, but now I want to use Rhino on the server and I am having some trouble. I have some simple java code that references the Rhino 1.7R2 release's js-14.jar file. Context context = Context.enter(); Scriptable scope = context...

jQuery access to 'this' object with events and triggers

I have two classes orchestrated by a main class and I would like to know how to gain access to the correct 'this' object when events are fired among these classes. Here's what I have: // My main class that orchestrates the two worker classes function MainClass() { this.workerOne = new ChildWorkerOne(); this.workerOne.bindBehavio...

How to handle javascript & css files across a site?

Hi everybody, I have had some thoughts recently on how to handle shared javascript and css files across a web application. In a current web application that I am working on, I got quite a large number of different javascripts and css files that are placed in an folder on the server. Some of the files are reused, while others are not. ...

Using Jquery to slowly hide a div

Hi everyone! I'm trying to make some code which finds if a div exists, and if it does then have it fade away slowly. I have this to determine whether or not the div exists if($('#error').length != 0) { $('#error').hide(500); } And that does work but only on a refresh, I've been attempting to put it in a timer like this: ...

php / mysql / javascript mindate and maxdate

Hi, In .net, there are the static properties DateTime.MinDate, and DateTime.MaxDate that conveniently return the minimum and maximum valid dates for a DateTime object. I'm dabbling in web programming right now, using php + mysql + javascript. There doesn't seem to be the same convenient min/max date values in that programming environme...

Javascript library/framework/widget to allow user to move and resize divs on page

Hi, I am looking at creating a page that the user can move around as they please...very similar to iGoogle. But in addition, ideally, I want the user to be able to resize the components. I've done quite a bit with jQuery in the past am not against the idea of using that, seeing as it already has the draggable and resizable options, tho...