开发者

jquery URL driven content management

开发者 https://www.devze.com 2023-04-09 21:23 出处:网络
So I am very new to jquery and need some help on a little project. Perhaps there is a script already in existen开发者_开发百科ce that I could use, if not I am hoping to find some direction.

So I am very new to jquery and need some help on a little project. Perhaps there is a script already in existen开发者_开发百科ce that I could use, if not I am hoping to find some direction.

I have found a few URL parsing scripts that allow me to dig through the query string and capture the value. Now what I want to do is take that variable and have it define what content is rendered on the page.

Here is an example, www.site.com renders normal site. But www.site.com/m/default.aspx?img=img1 would hide a parent div that contains all the sites content and .show a hidden div containing a supplemental image. But, www.site.com/m/default.aspx?img=img2 would show an alternative div with yet another image.

Seen something like this done before? Any resources that might help me out?

Thanks a million to all and any that help.

-Travis


I have written some code, I hope this solves your problem: http://jsfiddle.net/fNjCk/

And yes,i do like nyan nyan cat :)

0

精彩评论

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

关注公众号