Welcome to WebmasterWorld Guest from 107.20.59.213

Forum Moderators: not2easy

Message Too Old, No Replies

syntax

     

wilderness

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

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Javascript.

Java is something entirely different.

wilderness

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

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

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

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



The Javascript code runs entirely in the browser.

lucy24

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

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



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

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

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



<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>
 

Featured Threads

Hot Threads This Week

Hot Threads This Month