homepage Welcome to WebmasterWorld Guest from 54.211.235.255
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
syntax
wilderness




msg:4429107
 4:51 pm on Mar 14, 2012 (gmt 0)

Could somebody tell me if this CSS, Java or whatever?

$(document).ready(function(){
$(window.location.hash).append('<a name="' + window.location.hash.replace('#','')+ '"></a>');
window.location.href=window.location.href;
});

This is to allow page anchors to function within Firefox, in which it functions as intended.

My curiosity is precautionary as I'm also interested in knowing if the lines present a vulnerability for hijacking links?

TIA

 

g1smd




msg:4429128
 5:55 pm on Mar 14, 2012 (gmt 0)

Javascript.

Java is something entirely different.

wilderness




msg:4429131
 6:00 pm on Mar 14, 2012 (gmt 0)

fancy meeting you over here ;)

You think the use presents any vulnerabilities?

I've in excess of 200 pages with anchor links in the content and want to be sure before I add this to those page headers?

g1smd




msg:4429135
 6:05 pm on Mar 14, 2012 (gmt 0)

The Javascript code runs entirely in the browser.

lucy24




msg:4429171
 7:15 pm on Mar 14, 2012 (gmt 0)

Could somebody tell me if this CSS, Java or whatever?

For future reference: You can tell it isn't CSS because CSS performs no actions ("append", "replace" etc). It's purely presentational.

:: peering into crystal ball ::

g1 clicked View Unread Posts-- or local equivalent-- and caught the word "syntax" ;)

rocknbil




msg:4429615
 4:38 pm on Mar 15, 2012 (gmt 0)

<doesntreallyrequireanswer> I'm curious as to why you'd need to resort to Javascript to use page anchors. This bit of JS forces a refresh of your page, doesn't it? Anchors work fine in FF with just the id attribute (not NAME. Name is deprecated for non-form elements.) </doesntreallyrequireanswer>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved