Re: [jQuery] jQuery Powered Sites - Keep the Links Coming

2007-03-30 Thread Chris Scott
Here's a link, but please don't anyone feel obligated to add it to the 
directory since I just did this for fun and to learn yet more about jQuery.

http://iamzed.com/tveetter/

That page runs the Twitter public timeline RSS through a (PHP) Swedish Chef 
converter and outputs the tweets.  Bork!  Bork!  Bork!

I used jQuery to allow toggling between that and the original language as well 
as the jheartbeat plugin and jQuery's load() to do an ajax refresh of the data 
every 10 seconds.

I'm sure the code isn't the best but what do you expect for a beer-fueled 
afternoon...  Of course, any suggestions are appreciated as far as the code 
goes.

-- 
Chris Scott
Adaptive Hosting Solutions, Inc.  | Blogzerk - blog hosting
http://www.adaptivehostingsolutions.com/  | http://www.blogzerk.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Using jQuery and Smarty

2007-02-14 Thread Chris Scott
I'm still a newbie to jQuery so until now I've been using standard HTML 
pages to try out new code.  Now, I need to integrate some jQuery into a 
site that uses Smarty templates.  I'd appreciate any suggestions on how 
people are using jQuery and Smarty.

My main sticking point right now is where/how to put the jQuery code for 
the page.  Sticking it in the template file would mean putting the 
script block outside the head which I don't really want.  To keep it in 
the PHP file, I think I'd need to set it as a template variable that 
outputs it to the head.  This is the way I'm leaning, but I'm not sure 
this is the best way to do it.

Thanks.

-- 
Chris Scott
Adaptive Hosting Solutions, Inc.  | Blogzerk - blog hosting
http://www.adaptivehostingsolutions.com/  | http://www.blogzerk.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Using jQuery and Smarty

2007-02-14 Thread Chris Scott
Mike Alsup wrote:
 Sticking it in the template file would mean putting the
 script block outside the head which I don't really want.
 
 Why does it mean that?  I put all that stuff in the template like this:
 
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 head
 script type=text/javascript src=js/jquery-pack.js/script
 script type=text/javascript
 {literal}
 $(function() {
 $('div.round').corner();
 });
 {/literal}
 /script
 {if $googleMaps}
 script type=text/javascript src=js/jquery.googlemaps.js/script
 script type=text/javascript src=yada-yada/script
 {/if}
 {if $thickbox}
 link rel=stylesheet type=text/css media=projection, screen
 href=css/thickbox.css /
 script type=text/javascript src=js/thickbox.js/script
 {/if}
 ...

Sorry, I should have noted I'm using a common header template file for 
all pages that gets included in the page template.  Something like this 
in a page template:
{include file=header.tpl}
[page content here]
{include file=footer.tpl}

I'm using the {if} statements to include the js files I need based on a 
variable I set in the PHP file like you have above.  Where I'm stuck is 
now to set the js needed for the jQuery code into the HEAD.

I guess I could use something like this in header.tpl
{if $jquerycode}
script type=text/javascript
$jquerycode
/script
{/if}

and set $jquerycode in my PHP file.

-- 
Chris Scott
Adaptive Hosting Solutions, Inc.  | Blogzerk - blog hosting
http://www.adaptivehostingsolutions.com/  | http://www.blogzerk.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Loading Flash on First Load in Session and Image After

2007-01-15 Thread Chris Scott
A friend of mine is designing a site and wants to show a Flash header on 
the first load of a page within a site during a visitor's session but 
then show an image on successive page loads in that session.

Here's how I did it w/jQuery and the Flash and Cookie plugins:
http://iamzed.com/jquery/flashonetime.html

First page load in the session should show Flash.  Reload the page and 
it should show an image.  Clear your session cookies or close your 
browser and then reload/go back to the page and you'll see the Flash 
again.  This degrades gracefully by displaying only an image if JS is 
disabled.

That's a demo page and the link at the bottom is to a blog post w/a bit 
more detail.  Hopefully someone finds this useful.  I'm a noob at jQuery 
so any suggestions for improvement are always appreciated.

-- 
Chris Scott
Adaptive Hosting Solutions, Inc.  | Blogzerk - blog hosting
http://www.adaptivehostingsolutions.com/  | http://www.blogzerk.com/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/