开发者

How do I use the onselect method of Jquery to goto a URL?

What I want to to is pretty basic. I have files that are number with dates, and when someone clicks a date on the calendar it should ope开发者_开发问答n that file.

For example, if someone clicks november 20th it should go to nov/20.htm or generally {month}/{day}.htm.

I've looked at the documentation and it mentions something about being able to call onselect: function(); but I'm not versed enough in jquery to know what function to call to do so.

So how do I do this?


When someone selects something from the box it will trigger the function:

$("#selectbox").change(function() {
    var selectedValue = $(this).val();

    // parse the value to the page you want
    var newURL = "...";

    location.href = newURL;    
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜