Whenever I'm trying to compose a post on the jQ forum, it takes (literally) one second for each character to appear after I type it in the compose-a-message window. Like right now, as I write this. I am using FF3 on Ubuntu 8.10. Is this known? Is there anything I can do about it?
Trying to do something with AJAX--and failing. Any help welcome.
I have a bunch of pages (page-1.php, page-2.php, etc.) that all share a navigation menu (menu.html), which menu is included in the pages server side. The pages all use jQuery and (obviously) PHP, but the menu is (at the moment) straight HTML. Now I need to add to the menu an item (menu-item.php) that is fetched by AJAX, with which I have precious little experience (in JQuery or anywhere else).
I figured I could just add it to menu.html as follows:
<ul>
<li><a href="...">Menu Item 1</a></li>
<li><a href="...">Menu Item 2</a></li>
<script type="text/javascript">
<!--
$.get("menu-item.php");
//-->
</script>
</ul>
But this doesn't work. The JS of course shows up in the page source, as viewed in FF, but it never fetches menu-item.php. What am I doing wrong?
P.S. The reason I want to use AJAX for this is that menu-item.php returns different content depending on the user's IP. And the reason I want to put it in menu.html is to avoid editing all the pages individually.
In the cycle plugin, if you don't want the timeout to be equal for all slides, you can write a function to calculate the timeout on a slide-by-slide basis. This function takes the basic form:
function calculateTimeout(currSlide, nextSlide, options, isForward) {
var index = options.currSlide;
if (index == 0) {
return ...;
} else if (index == ...) {
return ...;
} else {
return ...;
}
}
It's easy to see how to set the timeout for the first slide: Just test for index == 0. But how do you identify the last slide if you don't know how many slides are in the show?