passing parameters to a jquery javascript function?

williamstiger

New Member
i have this jquery function that i want to pass \[code\]topic\[/code\] parameter to, i just dont know how to pass it lol :)).the jquery function:\[code\]function loadPage(url) //the function that loads pages via AJAX{ url=url.replace('#page',''); //strip the #page part of the hash and leave only the page number $('#loading').css('visibility','visible'); //show the rotating gif animation $.ajax({ //create an ajax request to load_page.php type: "POST", url: "load_page.php", data: 'page='+url, //with the page number as a parameter dataType: "php", //expect html to be returned success: function(msg){ if(parseInt(msg)!=0) //if no errors { $('#change-container').html(msg); //load the returned html into pageContet $('#loading').css('visibility','hidden'); //and hide the rotating gif } } });}\[/code\]and this is the url:\[code\]http://localhost/final/home.php#page2&topic=jquery\[/code\]when i click this link, the page load fines(using jquery), but its not passing the topic parameter!\[code\]<h3 class="timeline"><?php echo $_GET["topic"]; ?> echo</h3>\[/code\]so this wnt echo, because it cnt access the topic param!! if you guys know what i mean :))
 
Back
Top