jquery script running on joomla with php type thing :D
hey guys i am after a little bit of help if i can get it,
basically i have this menu system which works using a couple of jquery scripts it all works fine etc, but now i am porting my site into a joomla design ( dont ask why just a challange
)
at the moment i have a module on the left which has my menu in and on the right is another module which loads the content depending on the outcome of the script:
at the moment what ihave done is not the finished product as i would like to make sure that this will work before moving to the next part of my script
before i go on and on and on ill show you what i have:
-
$(document).ready(function(){
$('ul.submenu>li a').click(function() {
$("div#defaultStuff").fadeOut("slow");
$(".content").fadeOut("slow");
var content_show = $(this).attr("title");
var artic = $.get("article.php");
$(".content").load(""+artic+"",false, function() {
$(".content").fadeIn("slow");
});
});
});
for the time being ignore the content_show variable that is for a later date which should help me get the correct article from the mysql database. ( that is considering i can pass a variable thro the get function - $.get("somephpfile.php" {"id" : ""+content_show+""}; _
then article.php looks like this:
-
<?php
include "config.php";
include "opendb.php";
$sql = "SELECT introtext FROM `jos_content` WHERE id = 46 LIMIT 0, 30 ";
$result = mysql_query($sql) or die('Error : ' . mysql_error());
$arr = mysql_fetch_row($result);
$results2 = $arr[0];
echo ($results2);
// echo ($sql);
?>
the php code works fine if i run it alone but when i try my menu with the click function it doesnt return anything at all.
thanks and i hope i make some sort of sense with my problem
Vards