On Sep 1, 7:26 pm, Mike Alsup <mal...@gmail.com> wrote:
> > I am trying to define an "onclick" event to a form button, so that
> > when I click this button, content from another webpage will overwrite
> > this page (not open a new webpage). I've tried the below code (sample)
> > which is not working.
>
> > <form action="/script" method="post">
> >   <..other elements../>
> >   <input type="button" name="jump" value="Jump" />
> > </form>
>
> > <script type="text/javascript">
> >  $(':button[name="jump"]').click(function() {
> >      $(document).load('/path/to/another_page.html');
> >  });
> > </script>
>
> To cause the browser to navigate to a different page, set the 'href'
> property of the window.location object:
>
> window.location.href = '/path/to/another_page.html';
>

worked, thank you very much. :-)

lihao

> https://developer.mozilla.org/en/DOM/window.location

Reply via email to