On-page Anchor Points [solved]
-
I am trying to put an on-page anchor point on a SharePoint (.aspx) page and get a syntax error. I have done this many times on html pages and even copied from an example on W3C to be sure I was doing it correctly. It worked in the "try it yourself" page on W3C but not on the .aspx page. I am doing this:
I think only id is necessary but put in the name attribute to see if that would work.
<a href="#jump_here">Jump to section of page.</a>
I am getting a syntax error but do not see where I have coded it wrong. Does anyone use on page links on a SharePoint page? What can I do to make this work without generating an error? <edit> Turns out it was a problem with my browser. I noticed I was getting a syntax error on web pages from other sites. A reset of my group policy fixed the problem and all works well using the code shown above. </edit>
The report of my death was an exaggeration - Mark Twain
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes -
I am trying to put an on-page anchor point on a SharePoint (.aspx) page and get a syntax error. I have done this many times on html pages and even copied from an example on W3C to be sure I was doing it correctly. It worked in the "try it yourself" page on W3C but not on the .aspx page. I am doing this:
I think only id is necessary but put in the name attribute to see if that would work.
<a href="#jump_here">Jump to section of page.</a>
I am getting a syntax error but do not see where I have coded it wrong. Does anyone use on page links on a SharePoint page? What can I do to make this work without generating an error? <edit> Turns out it was a problem with my browser. I noticed I was getting a syntax error on web pages from other sites. A reset of my group policy fixed the problem and all works well using the code shown above. </edit>
The report of my death was an exaggeration - Mark Twain
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopesJimmyRopes wrote:
Does anyone use on page links on a SharePoint page? What can I do to make this work without generating an error?
Standard-HTML anchors are broken in SharePoint. There are many solutions on google[^]. You can find two examples on http://yalla.itgroove.net/2012/05/anchor-links-tags-in-sharepoint-2010/[^]
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
JimmyRopes wrote:
Does anyone use on page links on a SharePoint page? What can I do to make this work without generating an error?
Standard-HTML anchors are broken in SharePoint. There are many solutions on google[^]. You can find two examples on http://yalla.itgroove.net/2012/05/anchor-links-tags-in-sharepoint-2010/[^]
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
Thanks for the information.
The report of my death was an exaggeration - Mark Twain
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes -
JimmyRopes wrote:
Does anyone use on page links on a SharePoint page? What can I do to make this work without generating an error?
Standard-HTML anchors are broken in SharePoint. There are many solutions on google[^]. You can find two examples on http://yalla.itgroove.net/2012/05/anchor-links-tags-in-sharepoint-2010/[^]
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
Thanks for the information. I tried what the link said, but it didn't work. By making the href JavaScript:; and the on click event this.href the anchor point name the syntax error did not happen but the page did not position at the anchor point. I did Google before I posted the question here and all I came up with was what was causing the syntax error. It is odd because the same code executes fine in an HTML page. If you can think of any other SharePoint specific links please let me know.
The report of my death was an exaggeration - Mark Twain
Simply Elegant Designs JimmyRopes Designs
Think inside the box! ProActive Secure Systems
I'm on-line therefore I am. JimmyRopes