need some jquery if-else statement help

Posted by zeemy23 on Stack Overflow See other posts from Stack Overflow or by zeemy23
Published on 2011-02-07T23:07:45Z Indexed on 2011/02/07 23:25 UTC
Read the original article Hit count: 254

Filed under:
|
|

Hello, the code below is broken, but I'm not sure how. I've definitely made some big assumptions here as a newbie.

I'm basically trying to create an if else where imBannerRotater functions on #cast if the variable is true and #pram if it is false.

How could I fix this to get that result?

The # are URLs.

Thanks!-zeem

$(document).ready(function(){
                    if (mmjsRegionName == 'CO')
                        {
                $("#cast").imBannerRotater({
                    return_type: 'json',
                    data_map: {
                        image_name: 'name',
                        url_name: 'url'
                    },
                        image_url: '#',
                        base_path: '#',
                });
                    }
                    else
                        {
                $("#pram").imBannerRotater({
                                return_type: 'json',
                                data_map: {
                                    image_name: 'name',
                                    url_name: 'url'
                                },
                                    image_url: '#',
                                    base_path: '#',
                });

            });

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery