jQuery ThemeSwitcher tool: "Cannot set property 'themeswitcher' of undefined"
I'm using prototype and scriptaculous on the same page as jQuery, so I've included a noConflict()
call. However, I'm getting the following error:
Uncaught TypeError: Cannot set property 'themeswitcher' of undefined
Uncaught TypeError: Object [object Object] has no method 'themeswitcher'
which points to this line in the themeswitcher
tool on jqueryui.com:
$.fn.themeswitcher = function(settin开发者_JAVA百科gs){
This is the structure of my page:
<head>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/base/jquery-ui.css" />
<script>
google.load("jquery", "1.5.1");
google.load("jqueryui", "1.8.6");
</script>
<script>
jQuery.noConflict();
</script>
<script>
jQuery(document).ready(function(){
jQuery('#switcher').themeswitcher();
});
</script>
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0/prototype.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js"></script>
<head>
<body>
<script type="text/javascript"
src="http://jqueryui.com/themeroller/themeswitchertool/">
</script>
<div id="switcher"></div>
</body>
Its covered here this will work for anyone http://www.dotnetcurry.com/ShowArticle.aspx?ID=658 regardless of code the PHP inside this javascript library threw me since I have limited experience with PHP but this http://jqueryui.com/themeroller/css/parseTheme.css.php?plus the huge query string is not running a script or if it is it just returns a css file which you could also download (by hitting the link) and refer to on you local server. The Rude Boy Solutions plugin I did not succeed in getting to work but I fear I referenced something incorrectly. After a bit more experimentation and realising these are not trying to run php in your IIS or VS.NET virtaul server but its running on the cdn (and just returning a file) and the file could or can be substituted jasonlau's blog no doubt would work. the .NET curry link was quick any easy for a .NET background person
Just a guess but it might save the next guy, you can't hot link to the properties being the images (date picker example images) in the theme swithcher tool, you will need to download these and the themeswitchertool.js and change it to reference the images after you download these to your local machine / server. There is a jQuery plugin you can use but it was a bit funky looking and obtrusive for what I wanted.
精彩评论