jQuery and javascript seem to be working well with mysidia's script. Sorry to bump, just wanted to tell you! Didn't try ajax yet, which you would need to be able to communicate with the php which communicates with the database
If you put the script tags (includes or the functions themselves) in the header.tpl of the theme you are using they work properly ^^
try it:
in header.tpl (remove comments):
Code:
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> /* include jquery without downloading it */
<script>
function alertme(){ /*simple JS function that makes a popup */
alert('omg');
}
$(document).ready(function(){ /* simple jQuery function that makes a popup when you click the menu (anywhere in the menu) */
$('div #menu').click(function(){
alert('OMGGG');
});
});
</script>
/////////REST OF CODE HERE////////////
</head>
template.tpl (to test first javascript alert):
Code:
///CODE BEFORE HERE///
<body onload="alertme()">
///REST OF CODE HERE///
And this makes it work in php pages (so the different elements/tags will work differently depending on the page)
inside the index() function
Code:
echo '<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>';
echo "<script>
$(document).ready(function(){
$('h1').click(function(){ /*send an alert when the title is clicked */
alert('OMG2');
});
});</script>";
JS and jQuery work on the HTML basically, makes it hard to use it on mysidia's pages (at least I haven't found a new way to create new ids and classes? I still don't quite get how it works)