Little help with some (simple) Javascript code

Posted by lerac on Stack Overflow See other posts from Stack Overflow or by lerac
Published on 2010-04-09T16:06:53Z Indexed on 2010/04/09 16:13 UTC
Read the original article Hit count: 281

Filed under:

I'm a newb when it comes to javascript. Perhaps somebody could help me with this. I assume it is not very complicated. This is what I would like:

<SCRIPT type=text/javascript>
    var StandardURL = "http://site/Lists/test/AllItems.aspx";
</script>

<SCRIPT type=text/javascript>
    var FilterURL = "http://site/Lists/test//AllItems.aspx?FilterField1=Judge&FilterValue1=";
</script>

var DynamicURL = FilterURL + DynamicUserInf (no space between it should be like one url link), dynamicuserinf contains different value depending on the user that is logged in no need to worry what is in it. It already contains a value befor this runs

Get current URL in [var CurrentURL]

<script language="JavaScript" type="text/javascript">
    if (CurrentURL == StandardURL) { location.href= (DynamicURL);}
</script>

ElSE do nothing (i assume this is not neccarry with only one if statement)

Hopefully not much of a mess.

© Stack Overflow or respective owner

Related posts about JavaScript