Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

URL dependant styling

  • 17-10-2010 1:47pm
    #1
    Registered Users, Registered Users 2 Posts: 15


    I need to implement a quick and dirty hack for the styling of a site, just need some simple styling dependent on the current URL of the page so I can get certain things underlined.

    I'm just unsure what code I'm supposed to be using.
    Would anyone have any pointers?

    Help appreciated.


Comments

  • Registered Users, Registered Users 2 Posts: 15 Duncan1001011


    nvm, I found this:
    function getQuerystring(key, default_)
    {
    if (default_==null) default_="";
    key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
    var qs = regex.exec(window.location.href);
    if(qs == null)
    return default_;
    else
    return qs[1];
    }


    The getQuerystring function is simple to use. Let's say you have the following URL:


    http://www.bloggingdeveloper.com?author=bloggingdeveloper


    and you want to get the "author" querystring's value:

    var author_value = getQuerystring('author');


Advertisement