Skip to Content
author's profile photo Former Member
Former Member

navigation->goto_page( 'page1.htm' ) and and html anchors

Hello,

we often use the command "navigation->goto_page", e.g. from handler OnInputProcessing in a BSP.

Now i have the must to give an html anchor with to the page, i tried it like this:

navigation->goto_page( 'page1.htm#anchor1' ).

But the i get the following error:

Access not possible using 'NULL' object reference

Thank you for any idea, how to handle this problem.

Regards

Marcus

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 27, 2004 at 10:48 AM

    actually I met the same problem, but I dont find any solution. If I find something, I will send a response 😉

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 28, 2004 at 06:59 PM

    Hello,

    i found a solution.

    1. Create a page attribute 'anker' auto, string

    2. Put the following Code in your BSP layout:

    -

    -


    <script language="javascript"> function getPositionanker(id) { /* var elem; try{ if (document.getElementById(id)) throw true; else throw false; } catch(e){ if (e) {elem=document.getElementById(id);} else {return 0;} } */ var elem=document.getElementById(id); var tagname="", y=0; while ((typeof(elem)=="object")&&(typeof(elem.tagName)!="undefined")) { y+=elem.offsetTop; //Offset des jeweiligen Elements addieren tagname=elem.tagName.toUpperCase(); // tag-Name ermitteln, Grossbuchstaben //wenn beim Body-tag angekommen elem fuer Abbruch auf 0 setzen if (tagname=="BODY") elem=0; // wenn elem ein Objekt ist und offsetParent enthaelt Offset-Elternelement ermitteln if (typeof(elem)=="object") if (typeof(elem.offsetParent)=="object") elem=elem.offsetParent; } return y; } function scrollToAnker(anker){ var y=getPositionanker(anker); window.scrollTo(0,y - 30); } var anker = "<%= me->anker %>"; </script> <% if me->anker is not initial. %> <body onload="scrollToAnker(anker);"> <% free me->anker. %> <% else. %> <body> <% endif. %>

    -

    -


    now you can fill the attribut 'ankerÄ and your site will automitcally scroll to th anchor without the need to be reload - i know its not a nice workout using JavaScript but it works ...

    Regards Marcus

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.