Spot on. Thanks for that.

On Fri, Apr 16, 2010 at 1:21 PM, T.J. Crowder <[email protected]>wrote:

> Hi,
>
> I don't see anything in that code that would do that. Are you by any
> chance calling this code from a link with its href set to '#'? If so,
> be sure to cancel the event; otherwise, the browser's normal
> navigation will go to that anchor, which is the top of the page.
>
> Example - link HTML:
>
>    <a href='#'>click to edit</a>
>
> Javascript:
>
>    document.observe("dom:loaded", function() {
>        $('the link id').observe('click', function(event) {
>            event.stop(); // <== stop the navigation
>            ajax_edit_possible_user(...);
>        });
>    }
>
> Or if you're doing this with inline syntax:
>
>    <a href='#' onclick='ajax_edit_possible_user(...); return
> false;'>click to edit</a>
>
> HTH,
> --
> T.J. Crowder
> Independent Software Consultant
> tj / crowder software / com
> www.crowdersoftware.com
>
>
> On Apr 16, 1:09 pm, stapes <[email protected]> wrote:
> > Hi
> > i am using ajax to allow the user to edit lines of the page using a
> > pop up page. Upon return, Ajax.Updater is called to refresh the part
> > that has changed - identified using a <div> header. Unfortunately, it
> > goes to the top of the page at this point, so the user loses his
> > place.
> >
> > here is my javascript code:
> >
> > function ajax_edit_possible_user(id)
> >         {
> >         window.showModalDialog('<?=$staging_url?>/qms/
> > ajax_edit_possible_user.php?id='+id,'name','height=600,width=900');
> >         Ajax_Update();
> >         }
> > function Ajax_Update()
> > {
> >         //alert ("Ajax_Update");
> >
> >         var url='<?=$staging_url?>/qms/ajax_user_list_div.php';
> >
> >         var divHdr="user_list_div";
> >
> >         var myAjax=new Ajax.Updater
> >                 (
> >                         divHdr,
> >                         url
> >                 )
> >
> > }
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> > To post to this group, send email to
> [email protected].
> > To unsubscribe from this group, send email to
> [email protected]<prototype-scriptaculous%[email protected]>
> .
> > For more options, visit this group athttp://
> groups.google.com/group/prototype-scriptaculous?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<prototype-scriptaculous%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to