Search - User list
Full Version: Javascript error (mySettings is not defined)
Root » Bugs » Javascript error (mySettings is not defined)
1
muzzy
Hi,

Thanks for the nice Django forum application!
Please, help me with a small javascript bug. I get
mySettings is not defined 
$(".markup").markItUp(mySettings); 

in my firefox console.

Thanks in advance.

Alex.
slav0nic
check is all js loaded correct
mySettings defined at static/forum/js/markitup/sets/bbcode/set.js
muzzy
Thanks for so quick answer!

JS files (I use /media directory instead of /static in my settings) are loaded.

I notice that this error raises when I am on forum as anonymous. When I am on forum as registered user (admin) the error doesn't raise.

Also, i checked head section of page:
as anonymous "set.js" isn't loaded
<head>
	<title>Django Bulletin Board  / *** / ******** </title>
	<meta name="description" content=" " />
	<meta name="keywords" content="" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	
	<link rel="stylesheet" type="text/css" href="/media/forum/themes/default/style.css" />

	<link rel="alternate" type="application/atom+xml" href="/forum/feeds/posts/" title="Последние сообщения на форуме" />
	<link rel="alternate" type="application/atom+xml" href="/forum/feeds/topics/" title="Последние темы на форуме" />

	<link rel="shortcut icon" href="/media/forum/favicon.png" type="image/png" />
	<script type="text/javascript">
		var MEDIA_URL = "/media/";
		var POST_PREVIEW_URL = "/forum/preview/";
	</script>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
	
		
	

	<script type="text/javascript" >
	   $(document).ready(function() {
	        $(".markup").markItUp(mySettings);
	   });
	</script>

    <!-- Highlightjs goodies -->
	<script type="text/javascript" src="/media/forum/js/highlight.pack.js"></script>
	<script type="text/javascript">
		hljs.initHighlightingOnLoad();
	</script>
	<link type="text/css" rel="stylesheet" href="/media/forum/css/hljs_styles/djangobb.css" />
	
	
</head>


as admin "set.js" is loaded:
<head>
	<title>Django Bulletin Board </title>
	<meta name="description" content=" " />
	<meta name="keywords" content="" />
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	
	<link rel="stylesheet" type="text/css" href="/media/forum/themes/default/style.css" />

	<link rel="alternate" type="application/atom+xml" href="/forum/feeds/posts/" title="Последние сообщения на форуме" />
	<link rel="alternate" type="application/atom+xml" href="/forum/feeds/topics/" title="Последние темы на форуме" />

	<link rel="shortcut icon" href="/media/forum/favicon.png" type="image/png" />
	<script type="text/javascript">
		var MEDIA_URL = "/media/";
		var POST_PREVIEW_URL = "/forum/preview/";
	</script>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
	
		
            <link rel="stylesheet" type="text/css" href="/media/forum/js/markitup/skins/markitup/style.css" />
            <link rel="stylesheet" type="text/css" href="/media/forum/js/markitup/sets/bbcode/style.css" />

            <script type="text/javascript" src="/media/forum/js/markitup/jquery.markitup.pack.js"></script>
            <script type="text/javascript" src="/media/forum/js/markitup/sets/bbcode/set.js"></script>
            <script type="text/javascript" src="/media/forum/js/markup/bbcode/board.js"></script>
        
	

	<script type="text/javascript" >
	   $(document).ready(function() {
	        $(".markup").markItUp(mySettings);
	   });
	</script>

    <!-- Highlightjs goodies -->
	<script type="text/javascript" src="/media/forum/js/highlight.pack.js"></script>

	<script type="text/javascript">
		hljs.initHighlightingOnLoad();
	</script>
	<link type="text/css" rel="stylesheet" href="/media/forum/css/hljs_styles/djangobb.css" />
	
	
<script type="text/javascript" src="/media/forum/js/jquery.cookie.js"></script>
<script type="text/javascript">
	
	function set_collapser(cat_id) {
		category_body_id = "category_body_" + cat_id;
		if($.cookie(category_body_id)){
			item_id = "#" + category_body_id; 
			head_id = item_id.replace("body", "head");
			$(head_id).addClass("collapsed");
			$(item_id).hide()
		}
	}
	$(document).ready(function(){	
		$("a.toggle").click(function(){
			header_id = $(this).parent().attr('id');
			body_id = header_id.replace("head", "body");
			item_id = '#' + body_id
			if ($(this).parent().attr('class')==''){
				$(this).parent().addClass("collapsed");
				$.cookie(body_id, 'collapsed');
			}else {
				$(this).parent().removeClass("collapsed");
				$.cookie(body_id, '');
			}
			$(item_id).slideToggle("slow");
		});
	
		set_collapser(1)
	
	});
</script>

</head>
muzzy
I have tested support.djangobb.org in the same manner, and I have got the same error for anonymous user.
slav0nic
fixed
muzzy
thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB