Using button control in google maps API

I am using the following code to cause events based upon button clicks. When I click the button,the page reloads but no change occurs in the map

form action="#" onsubmit="animate();  return false"  p  inputtype="submit"value="Zoom!" /  /p  /form  function animate() {   map.setZoom(10);  }

Can anyone help me out with this? Thank you

Answers


If you've got return false, and the page reloads, that usually implies to me that there's a javascript error. Check the javascript error logs, or use Firebug, to see if there are errors happening. e.g. is map defined as a global variable?


Need Your Help

How to work visually with a class that extends a Component in NetBeans?

java swing netbeans jpanel

I have a class which extends JPanel. I need a way to work with that visually just like a JPanel in NetBeans. I mean NetBeans gives me Design tab for that. What should I do?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.